User Tools

Site Tools


update-alternatives

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

auto and manual mode

auto mode will be used when no manual setting is made

auto modeThe program to be used is automatically selected based on the priority value of the alternatives. The one with the highest priority gets set
manual modeThe 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

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

TypeCommandSet withDefault
Webbrowsersensible-browserupdate-alternatives --config x-www-browserFirefox esr
Editorsensible-editorupdate-alternatives --config editorvi
Pagersensible-pagerupdate-alternatives --config pagerless

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.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
update-alternatives.txt · Last modified: 21-02-2024 17:11 by wim