update-alternatives

A convenient tool for maintaining symbolic links to determine default commands.

Install

All systems
curl cmd.cat/update-alternatives.sh
Debian Debian
apt-get install dpkg
Ubuntu
apt-get install dpkg
Alpine
apk add dpkg
image/svg+xml Kali Linux
apt-get install dpkg
CentOS
yum install chkconfig
Fedora
dnf install chkconfig
OS X
brew install dpkg
Raspbian
apt-get install dpkg
Docker
docker run cmd.cat/update-alternatives update-alternatives powered by Commando

A convenient tool for maintaining symbolic links to determine default commands.

  • Add a symbolic link:
    sudo update-alternatives --install path/to/symlink command_name path/to/command_binary priority
  • Configure a symbolic link for "java":
    sudo update-alternatives --config java
  • Remove a symbolic link:
    sudo update-alternatives --remove java /opt/java/jdk1.8.0_102/bin/java
  • Display information about a specified command:
    update-alternatives --display java
  • Display all commands and their current selection:
    update-alternatives --get-selections

© tl;dr; authors and contributors