2017-10-13 08:42:02 +01:00
|
|
|
# update-alternatives
|
|
|
|
|
2024-02-25 10:46:24 +00:00
|
|
|
> Convenientily maintain symbolic links to determine default commands.
|
2021-07-11 18:17:29 +01:00
|
|
|
> More information: <https://manned.org/update-alternatives>.
|
2017-10-13 08:42:02 +01:00
|
|
|
|
|
|
|
- Add a symbolic link:
|
|
|
|
|
2017-10-24 05:33:41 +01:00
|
|
|
`sudo update-alternatives --install {{path/to/symlink}} {{command_name}} {{path/to/command_binary}} {{priority}}`
|
2017-10-13 08:42:02 +01:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Configure a symbolic link for `java`:
|
2017-10-24 03:17:54 +01:00
|
|
|
|
2017-10-24 05:33:41 +01:00
|
|
|
`sudo update-alternatives --config {{java}}`
|
2017-10-13 08:42:02 +01:00
|
|
|
|
|
|
|
- Remove a symbolic link:
|
|
|
|
|
2017-10-24 05:33:41 +01:00
|
|
|
`sudo update-alternatives --remove {{java}} {{/opt/java/jdk1.8.0_102/bin/java}}`
|
2017-10-13 08:42:02 +01:00
|
|
|
|
2017-10-22 12:54:39 +01:00
|
|
|
- Display information about a specified command:
|
2017-10-13 08:42:02 +01:00
|
|
|
|
2017-10-24 05:33:41 +01:00
|
|
|
`update-alternatives --display {{java}}`
|
2018-10-16 18:30:40 +01:00
|
|
|
|
|
|
|
- Display all commands and their current selection:
|
|
|
|
|
|
|
|
`update-alternatives --get-selections`
|