User Tools

Site Tools


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/' as idea to /usr/bin

sudo update-alternatives --install /usr/bin/idea idea /opt/intellij/idea-IU-182.4892.20/bin/ 1

If there are multiple version you can list it with:

sudo update-alternatives --display idea

idea - manual mode
  link best version is /opt/intellij/idea-IU-181.4445.78/bin/
  link currently points to /opt/intellij/idea-IU-181.4445.78/bin/
  link idea is /usr/bin/idea
/opt/intellij/idea-IU-181.4445.78/bin/ - priority 1
/opt/intellij/idea-IU-182.4892.20/bin/ - priority 1

And select with

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/   1         auto mode
* 1            /opt/intellij/idea-IU-181.4445.78/bin/   1         manual mode
  2            /opt/intellij/idea-IU-182.4892.20/bin/   1         manual mode

Press <enter> to keep the current choice[*], or type selection number:
linux/update-alternatives.txt · Last modified: 2018/10/27 11:53 by els