Thursday, May 9, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3698  / 2 Years ago, sat, december 18, 2021, 12:17:58

I want to add vimb to the default browsers in x-www-browser. I don't see it in update-alternatives --config x-www-browser, so I think I have to --install it. After some time spent in reading man update-alternatives and searching, I came up with this:



update-alternatives --install /usr/local/bin/vimb x-www-browser /usr/local/bin/vimb 30


It seems stupid (the repeating arguments), but I think I haven't understood the manual correctly. What exactly do I have to pass at link and path?



COMMANDS
--install link name path priority [--slave link name path]...

link is the generic name for the master link,
name is the name of its symlink in the alternatives directory, and
path is the alternative being introduced for the master link.

TERMINOLOGY
alternatives directory
A directory, by default /etc/alternatives, containing the symlinks.

alternative name
The name of a symbolic link in the alternatives directory.

alternative (or alternative path)
The name of a specific file in the filesystem, which may be made accessible via
a generic name using the alternatives system.


Do I have to make a copy of /usr/local/bin/vimb in /etc/alternatives or what?


More From » command-line

 Answers
6

The manpage is somewhat confusing IMHO, but the key parts seem to be




--install link name path priority [--slave link name path]...
Add a group of alternatives to the system. link is the generic
name
for the master link, name is the name of its symlink in the
alternatives directory, and path is the alternative being intro‐
duced
for the master link.


where generic name is described in the TERMINOLOGY section as




generic name (or alternative link)
A name, like /usr/bin/editor, which refers, via the alternatives
system, to one of a number of files of similar function.


whereas the actual executable target is referred to as the path




alternative (or alternative path)
The name of a specific file in the filesystem, which may be made
accessible via a generic name using the alternatives system.


so in your case it needs to be



update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/local/bin/vimb 30

[#16860] Saturday, December 18, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nerta

Total Points: 414
Total Questions: 103
Total Answers: 97

Location: England
Member since Wed, Apr 19, 2023
1 Year ago
;