Update-alternatives is a script for switching between multiple commands of the same type and can be installed in Debian via the Apt-get install dpkg. Before explaining the details of Update-alternatives, let's take a look at the examples already in the system. Open the terminal and execute the following command:
Ls
Results: lrwxrwxrwx 1 root root 2011-03-12 15:20/usr/bin/java-/etc/alternatives/java
ls -l/etc/alternatives/java
Results: lrwxrwxrwx 1 root root 2011-03-12 15:20/etc/alternatives/java-/usr/lib/jvm/java-6-openjdk/jre/bin/java
Java, the executable command is actually a link, pointing to the/etc/alternatives/java. And this is a link to the/usr/lib/jvm/java-6-openjdk/jre/bin/java, which is the final executable file. Such two links are created to facilitate scripting and system management.
a 、--display
This parameter allows us to see all the optional commands for a command, as follows:
Update-alternatives--display Java
Two 、--config
This parameter is used to select a link value for a command, which is equivalent to switching between available values.
three 、--install
This parameter is used to add a link value for a command, which is equivalent to adding an available value, where slave is useful.
update-alternatives–Install /usr/bin/java java/usr/local/jre1. 6 - Update-alternatives–install /usr/bin/java java/usr/local/jre1. 6 –slave/usr/bin/javac Javac/usr/local/jre1. 6. 0_20/bin/javac
--remove
This parameter is used to delete the link value of a command, and the accompanying slave will be deleted together.
Update-alternatives–remove Java/usr/local/jre1. 6
Excerpt from: http://paddy-w.iteye.com/blog/958062
Update-alternatives command