Linux alternatives command. Maintain multiple versions of a package.

preview_player
Показать описание
In this video we demonstrate the update-alternatives command of Debian based systems.

We install a second version of the gcc compiler and show how to create a group of alternatives for gcc versions and how to switch between them.
In that way you can easily interchange between versions of a package and work with it as the default installed version in your system.

The update-alternatives command to create a group of alternatives is:
sudo update-alternatives --install "link" "name" "path" "priority"
where, "name" is the generic name for the master link,
"link" is the symlink of master link pointing to /etc/alternatives,
"path" is the alternative being introduced for the master link,
"priority" is an integer setting the priority list of the alternatives group.

For REHL/Fedora based systems the equivalent command is:
sudo alternatives --install "link" "name" "path" "priority"
however, the installation of another version of an already installed package is more tricky since the rpm repos do not offer multiple versions of the same package. Therefore, you need to install by source or find trickiest ways.

To inspect the alternatives of a group use the command:
update-alternatives --query "name"
and to change manually between the alternatives versions:
sudo update-alternatives --config "name"

To remove explicitly an alternative run the command:
sudo update-alternatives --remove "name" "path"
---------------------------------------------------------------------------------------
References:
Рекомендации по теме
Комментарии
Автор

Hi. Thank you for the video. But I really loved the background track you used. May I know the artist or the name of the track..:)

livelabs