update-alternatives --install
update-alternatives --install is a command used in Linux systems to add or update the alternatives for a particular command or executable file.
The syntax for using this command is:
update-alternatives --install <link> <name> <path> <priority>
where:
<link>is the symbolic link to be created or updated.<name>is the name of the alternative.<path>is the path of the actual executable file.<priority>is a number used to determine the default alternative.
For example, if you want to add an alternative for the editor command, you can use the following command:
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100
This command creates a symbolic link /usr/bin/editor that points to the executable file /usr/bin/vim and sets the priority to 100.
You can then use the command update-alternatives --config editor to select the default editor from the available alternatives
原文地址: http://www.cveoy.top/t/topic/d9RI 著作权归作者所有。请勿转载和采集!