Skip to content

Instantly share code, notes, and snippets.

@FrannyZhao
Last active July 5, 2019 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrannyZhao/e9b6e2c927fbc4c29ce40cc342597330 to your computer and use it in GitHub Desktop.
Save FrannyZhao/e9b6e2c927fbc4c29ce40cc342597330 to your computer and use it in GitHub Desktop.
ubuntu set alternative
添加2个make版本:
$ sudo update-alternatives --install /usr/bin/make make /usr/bin/make3.81 1010
update-alternatives: using /usr/bin/make3.81 to provide /usr/bin/make (make) in auto mode
$ sudo update-alternatives --install /usr/bin/make make /usr/bin/make4.1 1011
update-alternatives: using /usr/bin/make4.1 to provide /usr/bin/make (make) in auto mode
查看一下是否添加成功:
$ sudo update-alternatives --display make
make - auto mode
link best version is /usr/bin/make4.1
link currently points to /usr/bin/make4.1
link make is /usr/bin/make
/usr/bin/make3.81 - priority 1010
/usr/bin/make4.1 - priority 1011
切换make版本:
$ sudo update-alternatives --config make
There are 2 choices for the alternative make (providing /usr/bin/make).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/make4.1 1011 auto mode
1 /usr/bin/make3.81 1010 manual mode
2 /usr/bin/make4.1 1011 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment