Ubuntu manage multiple versions of the software tools update-alternatives command

alternatives commonly used to install the same software on multiple versions of the same system

update-alternatives --install <link> <name> <path> <priority>
  • install express installation
  • link is a symbolic link
  • name is the identifier
  • path is the path (absolute path) of the executable file
  • priority, said priority

For example, to install multiple versions of cmake tool,

update-alternatives --install /usr/bin/cmake cmake ~/develop_tools/cmake-3.15.6-linux-x86_64/bin/cmake 3
update-alternatives --install /usr/bin/cmake cmake ~/develop_tools/cmake-3.12.1-linux-x86_64/bin/cmake 2
update-alternatives --install /usr/bin/cmake cmake ~/usr/bin/cmake-3.5.1 1

Select the desired version with the following command cmake

update-alternatives --config cmake

Guess you like

Origin www.cnblogs.com/cristiano-duan/p/12538596.html