Update-alternatives command

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.