Table of Contents
If you want to send us your comments, please do so. Thanks
More on comments
Update-alternatives
In all examples editor is used as the group name. It can be replaced with an other group name where applicable. Some other important groupnames can be
- x-www-browser
- www-browser
- mutt
Manpage and useful links
man update-alternatives
Debian Alternatives
Using the Debian alternatives system
Debian wiki - Alternatives for the text editor
auto and manual mode
auto mode will be used when no manual setting is made
auto mode | The program to be used is automatically selected based on the priority value of the alternatives. The one with the highest priority gets set |
manual mode | The selected alternative is set as the program to be used. The priority value is ignored |
Commands options
The higher the number's value the higher the priority
Show all groups and the selected program for that group
update-alternatives --get-selections
Show all groups with alternatives and optionally change individual groups
update-alternatives --all
Display information about the group
update-alternatives --list editor update-alternatives --display editor
Show and optionally change a specific group
update-alternatives --config editor
Set the auto entry active in the group editor. The entry with the highest priority number will be choosen
update-alternatives --auto editor
Add a program to a group. In this example gedit is added to editor group with priority 15
update-alternatives --install /usr/bin/editor editor /usr/bin/gedit 15 update-alternatives --install /usr/bin/www-browser www-browser /usr/bin/firefox 15
Change the priority value. Just install the item again. Change the priority for gedit to 45 do
update-alternatives --install /usr/bin/editor editor /usr/bin/gedit 45
Remove an item from a group, gedit is removed
update-alternatives --remove editor /usr/bin/gedit
For scriptable use
Show extended information about a group
update-alternatives --query editor
Change a specific group. In group editor /usr/bin/vim.basic is set as default
update-alternatives --set editor /usr/bin/vim.basic
Files
The configuration file can be found at
/var/lib/dpkg/alternatives/editor
Priorities and other settings can be changed manually
Links groups
A master link and its associated slaves make up a link group
Trouble shooting
When the desired item can not be chosen a solution can be to add an extra item after which the desired item can be chosen
Sensible-* commands
debian-sensible-browser
is just a name, not a command. The command is sensible-browser
Type | Command | Set with | Default |
---|---|---|---|
Webbrowser | sensible-browser | update-alternatives --config x-www-browser | Firefox esr |
Editor | sensible-editor | update-alternatives --config editor | vi |
Pager | sensible-pager | update-alternatives --config pager | less |
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.