2017-10-13 15:42:02 +08:00
|
|
|
# update-alternatives
|
|
|
|
|
2017-10-23 12:09:28 +08:00
|
|
|
> A convenient tool for maintaining symbolic links to determine default commands.
|
2017-10-13 15:42:02 +08:00
|
|
|
|
|
|
|
- Add a symbolic link:
|
|
|
|
|
2017-10-24 10:03:41 +05:30
|
|
|
`sudo update-alternatives --install {{path/to/symlink}} {{command_name}} {{path/to/command_binary}} {{priority}}`
|
2017-10-13 15:42:02 +08:00
|
|
|
|
2017-10-24 10:03:41 +05:30
|
|
|
- Configure a symbolic link for "java":
|
2017-10-24 10:17:54 +08:00
|
|
|
|
2017-10-24 10:03:41 +05:30
|
|
|
`sudo update-alternatives --config {{java}}`
|
2017-10-13 15:42:02 +08:00
|
|
|
|
|
|
|
- Remove a symbolic link:
|
|
|
|
|
2017-10-24 10:03:41 +05:30
|
|
|
`sudo update-alternatives --remove {{java}} {{/opt/java/jdk1.8.0_102/bin/java}}`
|
2017-10-13 15:42:02 +08:00
|
|
|
|
2017-10-22 19:54:39 +08:00
|
|
|
- Display information about a specified command:
|
2017-10-13 15:42:02 +08:00
|
|
|
|
2017-10-24 10:03:41 +05:30
|
|
|
`update-alternatives --display {{java}}`
|
2018-10-16 19:30:40 +02:00
|
|
|
|
|
|
|
- Display all commands and their current selection:
|
|
|
|
|
|
|
|
`update-alternatives --get-selections`
|