tldr/pages/linux/update-alternatives.md

24 lines
625 B
Markdown
Raw Normal View History

2017-10-13 08:42:02 +01:00
# update-alternatives
2017-10-23 05:09:28 +01:00
> A convenient tool for maintaining symbolic links to determine default commands.
2017-10-13 08:42:02 +01:00
- Add a symbolic link:
`sudo update-alternatives --install {{path/to/symlink}} {{command_name}} {{path/to/command_binary}} {{priority}}`
2017-10-13 08:42:02 +01:00
- Configure a symbolic link for "java":
`sudo update-alternatives --config {{java}}`
2017-10-13 08:42:02 +01:00
- Remove a symbolic link:
`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
`update-alternatives --display {{java}}`
- Display all commands and their current selection:
`update-alternatives --get-selections`