Use the update-alternatives command in Linux, updatealternatives

Source: Internet
Author: User

Use the update-alternatives command in Linux, updatealternatives

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

Update-alternatives is a command used by the ubuntu system to switch the software version. For example, if there are several jdk versions in the system, map the directories where these commands are located to a unified system directory as links, and then manage them through update-alternatives, set the default start version. You can use update-alternatives -- help to view the detailed usage of the command,

1. display options

View all links of a command. Detailed information is displayed, including the mode (manual or automatic) and the priority value of the link,

2. install option (-- install <link> <Name> <path> <priority> [-- slave <link> <Name> <path>])

Add a new command link. <link> is the public link directory of the command in the system, <Name> name of the command link, and <path> is the directory where the newly added command is located, <priority> is a value. When the mode is automatic, the system selects a value to start.

For example: update-alternatives -- install/usr/bin/java/usr/lib/java/jdk-1.8.0_92/bin/java 300. The installed JDK 8 is mapped from its installation location to the/usr/bin/java link of the system. When the java command is executed, the system selects one of the versions of all links for execution.

3. config options

Lists all the link options of this command, and you can select a default start link as prompted.

4. remove option (-- remove <Name> <path>)

The path is the directory of the link to be deleted by the command, not the public directory of the system. If you want to delete all the links of this command, the -- remove-all option is used, naturally, this option does not require a path because all paths are deleted.

5. auto Option

This is relatively simple, that is, to set a command to the automatic mode.

 

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.