HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

update-alternatives — Convenientily maintain symbolic links to determine default commands. More information: <https://mann

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandsymbolicdetermineclilinksconvenientilymaintainupdate-alternatives
linux

Problem

How to use the update-alternatives command: Convenientily maintain symbolic links to determine default commands. More information: <https://manned.org/update-alternatives>.

Solution

update-alternatives — Convenientily maintain symbolic links to determine default commands. More information: <https://manned.org/update-alternatives>.

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

Code Snippets

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

Context

tldr-pages: linux/update-alternatives

Revisions (0)

No revisions yet.