25

What does priority mean in update-alternatives?

what does a smaller priority value mean?

How is priority related to and different from the default one "*"?

Thanks. For example:

$ sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode
  1            /usr/bin/gij-4.6                                1046      manual mode
  2            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode
* 3            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
  4            /usr/lib/jvm/jdk1.7.0_67/bin/java               1         manual mode
Tim
  • 25,177

1 Answers1

12

From man update-alternatives:

Each alternative has a priority associated with it.  When a link  group  is  in  automatic
mode,  the  alternatives  pointed  to by members of the group will be those which have the
highest priority.

It can be any integer, even negative (see example in manpage).

If the alternative is set manually, priority has no relation to the default.

Pablo Bianchi
  • 15,657
muru
  • 197,895
  • 55
  • 485
  • 740