Linux System update-alternatives Command use

Source: Internet
Author: User
Tags new set

Personal blog Address: http://www.cnblogs.com/wdfwolf3/

Update-alternatives is a command that Ubuntu systems use for software version switching. For example, there are several versions of the JDK in the system that map the directories of these commands to a system directory as a link, then manage them through update-alternatives and set the default startup version. With update-alternatives--help You can see the detailed usage of the command,

1.display Options

View all links to a command, detailed information display, including the mode (manual or automatic), the link's priority value,

2.install Options (--install < links > < name > < path > < priority > [--slave < link > < name > < path;])

Add a new set of command links,< link > is the public link directory for this command in the system,< name > Command link name,< path > is the directory where the newly added command is located,< priority > is a numeric value, When the mode is automatic, the system selects a large startup value.

As an example: Update-alternatives--install/usr/bin/java Java/usr/lib/java/jdk-1.8.0_92/bin/java 300. The installed JDK8 is mapped from its installation location to the system's/usr/bin/java link so that when the Java command is executed, the system chooses an execution from all linked versions.

3.config Options

List all the link options for this command, and you can choose a default startup link as prompted.

4.remove Options (--remove < name > < path >)

The path is the directory where the command wants to delete the link, not the system public directory, if you want to remove this command link is the--remove-all option, naturally this option does not need to add path, because all the paths are deleted.

5.auto Options

This is simple, which is to set a command to Auto mode.

Linux System update-alternatives Command use

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.