Sélection des alternatives

Mise à jour : Bullseye / Debian 11.2

Sommaire

1 - Installation

La commande update-alternatives est fournie par le paquet dpkg et est donc automatiquement installée

2 - Utilisation

$ update-alternatives --get-selections 
.......
desktop-background auto /usr/share/desktop-base/active-theme/wallpaper/contents/images/1920x1080.svg
desktop-background.xml auto /usr/share/desktop-base/active-theme/wallpaper/gnome-background.xml
desktop-grub auto /usr/share/desktop-base/active-theme/grub/grub-16x9.png
desktop-lockscreen.xml auto /usr/share/desktop-base/active-theme/lockscreen/gnome-background.xml
desktop-login-background auto /usr/share/desktop-base/active-theme/login/background.svg
desktop-plasma5-wallpaper auto /usr/share/desktop-base/active-theme/wallpaper
desktop-theme auto /usr/share/desktop-base/homeworld-theme
.....
editor auto /bin/nano
.....
gnome-www-browser auto /usr/bin/firefox-esr
....
java auto /usr/lib/jvm/java-11-openjdk-amd64/bin/java
.....
lightdm-greeter auto /usr/share/xgreeters/lightdm-gtk-greeter.desktop
locate auto /usr/bin/mlocate
......
www-browser auto /usr/bin/links2
x-cursor-theme auto /usr/share/icons/Adwaita/cursor.theme
x-session-manager auto /usr/bin/startxfce4
x-terminal-emulator auto /usr/bin/xfce4-terminal.wrapper
x-window-manager auto /usr/bin/xfwm4
x-www-browser auto /usr/bin/firefox-esr
$ update-alternatives --list editor
/bin/nano
/usr/bin/vim.tiny
$ sudo update-alternatives --config editor
Il existe 2 choix pour l'alternative editor (qui fournit /usr/bin/editor).

Sélection Chemin Priorité État
------------------------------------------------------------
* 0 /bin/nano 40 mode automatique
1 /bin/nano 40 mode manuel
2 /usr/bin/vim.tiny 15 mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :

$ sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim.tiny 30
$ sudo update-alternatives --auto editor