User Tools

Site Tools


linux:update-alternatives

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:update-alternatives [2018/10/27 11:53] (current)
els created
Line 1: Line 1:
 +Using update-alternatives has some advantages. Here a sample how to add for example IntelliJ.
  
 +Add the application '/​opt/​intellij/​idea-IU-182.4892.20/​bin/​idea.sh'​ as idea to /usr/bin
 +<​code>​
 +sudo update-alternatives --install /​usr/​bin/​idea idea /​opt/​intellij/​idea-IU-182.4892.20/​bin/​idea.sh 1
 +</​code>​
 +
 +If there are multiple version you can list it with:
 +<​code>​
 +sudo update-alternatives --display idea
 +
 +idea - manual mode
 +  link best version is /​opt/​intellij/​idea-IU-181.4445.78/​bin/​idea.sh
 +  link currently points to /​opt/​intellij/​idea-IU-181.4445.78/​bin/​idea.sh
 +  link idea is /​usr/​bin/​idea
 +/​opt/​intellij/​idea-IU-181.4445.78/​bin/​idea.sh - priority 1
 +/​opt/​intellij/​idea-IU-182.4892.20/​bin/​idea.sh - priority 1
 +</​code>​
 +
 +And select with
 +<​code>​
 +sudo update-alternatives --config idea 
 +There are 2 choices for the alternative idea (providing /​usr/​bin/​idea).
 +
 +  Selection ​   Path                                           ​Priority ​  ​Status
 +------------------------------------------------------------
 +  0            /​opt/​intellij/​idea-IU-181.4445.78/​bin/​idea.sh ​  ​1 ​        auto mode
 +* 1            /​opt/​intellij/​idea-IU-181.4445.78/​bin/​idea.sh ​  ​1 ​        ​manual mode
 +  2            /​opt/​intellij/​idea-IU-182.4892.20/​bin/​idea.sh ​  ​1 ​        ​manual mode
 +
 +Press <​enter>​ to keep the current choice[*], or type selection number:
 +</​code>​
linux/update-alternatives.txt ยท Last modified: 2018/10/27 11:53 by els