Linux command update-alternatives let you choose the default program for different contexts.
Imagine you want to choose vscode as your default text editor, the way to update that in ubuntu is (if you already know its configuration name):
sudo update-alternatives --config editor
But what if I want to update other default application? How do we know those configuration names? Easy, they are all listed in /etc/alternatives.
In fact, update-alternatives cli, updates those configuration files by making symlinks.
There are six options for setting the default program:
- install
- config
- set
- remove
- auto
- display
install configures a new symlink to the actual config file. You can have plenty different options for a config file. Think of java and its different providers (openjdk and oracle, for example).
config sets your preferred program as default.
set
remove
auto
display