LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2004, 07:51 PM   #1
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Rep: Reputation: 30
Please help to explain the syntax for 'update-alternatives'


Usage: update-alternatives --install <link> <name> <path> <priority>
[--slave <link> <name> <path>] ...

<name> is the name in /etc/alternatives.
<path> is the name referred to.
<link> is the link pointing to /etc/alternatives/<name>.
<priority> is an integer; options with higher numbers are chosen.

I'm trying to update my /usr/bin/vi to use gvim instead of vim. Currently, /usr/bin/vi is a symbolic link pointing to /etc/alternatives/vi.

david:/home/david# ls -l /usr/bin/vi
lrwxrwxrwx 1 root root 20 Apr 3 11:49 /usr/bin/vi -> /etc/alternatives/vi

david:/home/david# update-alternatives --display vi
vi - status is auto.
link currently points to /usr/bin/vim
/usr/bin/nvi - priority 30
slave vi.1.gz: /usr/share/man/man1/nvi.1.gz
/usr/bin/vim - priority 120
slave vi.1.gz: /usr/share/man/man1/vim.1.gz
Current `best' version is /usr/bin/vim.

So, I tried this command
Code:
update-alternatives --install /usr/bin/vi vi /usr/bin/gvim 130 --slave /usr/bin/vi vi.1.gz /usr/share/man/man1/vi.1.gz
Entering this command will return me the help file on update-alternatives instead. I suspect the syntax for my --slave arguement is wrong, most likely the <link>. What link is pointing to vi.1.gz , since the <name> is vi.1.gz and is pointing to <path> /usr/share/man/man1/vim.1.gz ?

I've read the man pages, but it doesn't elaborate further on the usage of the --slave arguement.

Please advise.

Thanks !

Last edited by davidas; 04-11-2004 at 06:16 AM.
 
Old 04-11-2004, 06:22 AM   #2
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Original Poster
Rep: Reputation: 30
Update: In addition to the above, I also changed the symbolic link in /etc/alternatives by hand, without using update-alternatives :

Code:
ln -sf /usr/bin/gvim /etc/alternatives/vi
However, even in /etc/alternatives directory itself, when I did a
Code:
vi <filename>
, the editor that is loaded is still vim (instead of gvim.

Any advice, please?

Thanks !
PS. Can't seem to find anything that elaborate on update-alternatives at Debian homepage.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
completely replacing exim with qmail -- update-alternatives? johnMG Debian 1 09-26-2005 04:13 PM
Vi alternatives Gins Linux - General 9 09-05-2005 10:29 AM
Alternatives to x? ampex189 Linux - Software 9 03-22-2005 01:21 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
Alternatives matahchuah Linux - Software 1 02-17-2004 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration