LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to add a program to update-alternatives (https://www.linuxquestions.org/questions/linux-software-2/how-to-add-a-program-to-update-alternatives-631303/)

Mountain 03-28-2008 12:34 PM

How to add a program to update-alternatives
 
My preferred editor is not listed when I run
Code:

sudo update-alternatives --config gnome-text-editor
How do you add items to this? Thanks

bigrigdriver 03-28-2008 04:26 PM

Don't know. Never heard of it.

Which GNU/Linux distro are you using? What application are you trying to run? etc, etc, etc.

Give more information relative to the problem, and you are more likely to get an answer.

Mountain 03-28-2008 06:43 PM

Quote:

Originally Posted by bigrigdriver (Post 3103486)
Don't know. Never heard of it.

Which GNU/Linux distro are you using? What application are you trying to run? etc, etc, etc.

Give more information relative to the problem, and you are more likely to get an answer.

I'm running Ubuntu (both Gutsy and Hardy beta on laptop/desktop).

I want to use SciTE text editor as my gnome-text-editor, but after installing SciTE using Synaptics, I do not have an option to select it when I run this code
Code:

sudo update-alternatives --config gnome-text-editor
I would like to add SciTE to that list. Thanks.

bigrigdriver 03-28-2008 08:46 PM

This might help: http://blog.stevenkroon.com/2006/08/...-alternatives/

Tinkster 03-28-2008 10:01 PM

Quote:

Originally Posted by Mountain (Post 3103307)
My preferred editor is not listed when I run
Code:

sudo update-alternatives --config gnome-text-editor
How do you add items to this? Thanks

I'm not really a ubuntu and/or debian-fan/-user, but ...
The man-page for the tool suggests two directories for you
to look at (you did read the man-page, right?).
Number 1:
/etc/alternatives
(holds links to the actual program to use, eg. editor is a
symlink to /usr/bin/vim)

Not a good place to start futzing around ...

Number 2:
/var/lib/dpkg/alternatives
Hmmm ... text-files, with content like:
Code:

auto
/usr/bin/gnome-text-editor
gnome-text-editor.1.gz
/usr/share/man/man1/gnome-text-editor.1.gz

/usr/bin/gedit
50
/usr/share/man/man1/gedit.1.gz
/usr/bin/vim.full
45

Hmmm ... might be a good place to start toying, of course I have
NO idea whether the maintainers of deb/*bunut share that view ;}



Cheers,
Tink

gnuzilla 12-07-2011 05:08 PM

Add new option to update-alternatives link, Correct Answer
 
To add a new item to update-alternatives, use the following options.

Code:

update-alternatives --install /usr/bin/$LINK $PROVIDES /usr/bin/$BIN $XX
So for example... (Assuming Luajit is not available in the --config list for /usr/bin/lua)
If The link I'm updating is /usr/bin/lua, which provides lua-interpreter. I want to add Luajit, with a priority of 90, to the /usr/bin/lua link.

Code:

update-alternatives --install /usr/bin/lua lua-interpreter /usr/bin/luajit-2.0.0-beta8 90

I'm providing the correct answer so it will be available, for anyone who lands here from Google. I hate having high relevancy results, not provide the appropriate information. I'm aware this is a 3+ years old thread.

BTW, update-alternatives is a Debian family specific command. I wouldn't need to be told explicitly which distro someone uses, to address something implicitly distro specific.

deepclutch 01-10-2012 12:22 PM

I have a doubt, is there a way to add man pages particularly for eg like the java man page using update-alternatives for curiousity sake? :)

iansane 06-09-2013 11:12 AM

And in 2013 I thank you gnuzilla :-)

It's like when you go to the hardware store and ask where the hammers are and the (insert rediculous job title like Industrial systems technical sales associate)says "duh... what are you going to do with it?" instead of the correct answer which would be "I don't know" or "isle 4"

aerique 09-24-2014 04:44 AM

Aaaaaaand... in 2014, thank you gnuzilla!

yogeshg1987 04-29-2015 09:24 PM

Aaand in 2015, thank you, gnuzilla..

ranixlb 05-25-2015 08:05 PM

thanks gunzilla

RootBash 01-01-2016 03:05 PM

And in 2016, thank you gnuzilla

ImNotARobot 01-19-2017 08:31 AM

2017, thanks gnuzilla!

ThanksGnuzilla 04-26-2020 06:53 AM

In 2020, thanks gnuzilla!

ramenspazz 06-25-2023 12:14 PM

In 2023, Thanks gnuzilla. A true hero in our time of need.


All times are GMT -5. The time now is 08:59 PM.