How to Install update-alternatives tool for maintaining symbolic link of a command

Posted on

Based on the title of this article, the subject discussion in this article is about how to install ‘update-alternatives’ tool. The ‘update-alternatives’ tool is a tool for maintaining symbolic link of a command.  This tool is available in the Linux-based operating system distribution. The information is available in the manual page available in the Linux-based operating system.  There will be an output containing the information about the main usage of ‘update-alternatives’ tool after the execution of the command ‘man update-alternatives’. Below is the following output  :

update-alternatives(1)                                       dpkg suite                                       update-alternatives(1)

NAME
       update-alternatives - maintain symbolic links determining default commands

In order to install the ‘update-alternatives’ tool, performing these steps will help installing the tool. The steps are compatible with Debian or Ubuntu based operating system. To execute it in another Linux-based operating system distribution, just change and adjust several commands. The adjustment is in the part of the command describing the package management tool. In the context of this article, ‘apt’ is the command representing the tool for package management tool in a Debian or Ubuntu Linux-based operating system. There are different commands in other Linux-based operating system. In order to execute the tool, just type the command ‘update-alternatives’ in the command line. The following is the execution of the ‘update-alternatives’ command :

user@hostname:~$ update-alternatives
update-alternatives: need --display, --query, --list, --get-selections, --config, --set, --set-selections, --install, --remove, --all, --remove-all or --auto

Use 'update-alternatives --help' for program usage information.
user@hostname:~$ 

To search the package name containing specific command, the following is the pattern for the command :

dpkg -S file_path_location : 

Description : 
dpkg : The command name for Debian or Ubuntu-based Linux operating system
-S : The additional parameter for searching package based on file name location
file_path_location : The location of the file name

In order to search the package of ‘update-alternatives, type the following command :

user@hostname:~$ dpkg -S /usr/bin/update-alternatives 
dpkg: /usr/bin/update-alternatives
user@hostname:~$ apt-cache show dpkg
Package: dpkg
Architecture: amd64
Version: 1.19.0.5ubuntu2
Multi-Arch: foreign
Priority: required
Essential: yes
Section: admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 6773
Pre-Depends: libbz2-1.0, libc6 (>= 2.14), liblzma5 (>= 5.2.2), libselinux1 (>= 2.3), libzstd1 (>= 1.3.2), zlib1g (>= 1:1.1.4)
Depends: tar (>= 1.28-1)
Suggests: apt, debsig-verify
Breaks: acidbase (<= 1.4.5-4), amule (<< 2.3.1+git1a369e47-3), beep (<< 1.3-4), im (<< 1:151-4), libdpkg-perl (<< 1.18.11), netselect (<< 0.3.ds1-27), pconsole (<< 1.0-12), phpgacl (<< 3.3.7-7.3), pure-ftpd (<< 1.0.43-1), systemtap (<< 2.8-1), terminatorx (<< 4.0.1-1), xvt (<= 2.1-20.1)
Filename: pool/main/d/dpkg/dpkg_1.19.0.5ubuntu2_amd64.deb
Size: 1139464
MD5sum: 655a349afa275cae790929defe2e07f8
SHA1: 74d1b2591b043ef8e74abbc6cc1ff53942e59ff5
SHA256: ece5ad51a21fb17c0f63a755a1e925097b5137e6c62c96a6f160696928259bc3
Homepage: https://wiki.debian.org/Teams/Dpkg
Description-en: Debian package management system
 This package provides the low-level infrastructure for handling the
 installation and removal of Debian software packages.
 .
 For Debian package development tools, install dpkg-dev.
Description-md5: 2f156c6a30cc39895ad3487111e8c190
Task: minimal
Supported: 5y

user@hostname:~$ 

The ‘update-alternatives’ is available in the first place because it is part of the dpkg package. It is the package management tool in Debian or Ubuntu Linux-based operating system by default. So, there is no need to install another package containing the ‘update-alternatives’ command.

Leave a Reply