28

When I run

$ update-alternatives --config java  

I get a few rows:

enter image description here

What is the difference between auto mode and manual mode?

2 Answers 2

23

In a nutshell, update-alternatives:

  • in Auto Mode, will select the generic name of the program automatically based on the Priority value of the alternatives; The one with the highest priority gets set as the generic name.

  • in Manual Mode, will set the generic name as the user selected alternative irrespective of the Priority value of the alternatives, hence the name "manual".

Check this:

% sudo update-alternatives --config editor
There are 5 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
* 3            /usr/bin/emacs24     0         manual mode
  4            /usr/bin/vim.basic   30        manual mode
  5            /usr/bin/vim.tiny    10        manual mode

Note that, /bin/nano is both available in auto and manual mode.

If the link group were set in auto mode then the alternative with the highest priority i.e. /bin/nano (priority 40) would be selected as the generic name i.e. /usr/bin/editor. This is the default until the user introduces any change to the link group.

On the other hand, in the manual mode, you can select any alternative as the generic name e.g. in the example, i have /usr/bin/emacs24 set as the generic /usr/bin/editor. You can select any one you like by using the Selection number on the left of the option.

Now I can revert back from the manual mode to auto mode by selecting 0 from the above or by:

sudo update-alternatives --auto editor
3
  • thanks @heemayl but maybe due to my bad English it isn't enough for me to understand what that difference means. Maybe an example could help me on that.
    – baudo2048
    Jun 9, 2016 at 21:31
  • @baudo2048 Example added..hope it will help you to understand..
    – heemayl
    Jun 9, 2016 at 22:12
  • Only time I've ever had to mess with manual mode was when I was testing compatibility issues with an older version of Java. But I like this explanation.
    – Wyatt Ward
    Jun 9, 2016 at 23:03
10

In "auto mode", update-alternatives will always select the alternative with the highest priority. If a new or upgraded package is installed which has a higher priority than any other alternative, it will be chosen as the auto alternative.

In "manual mode", update-alternatives will never override the sysadmin's choice, no matter what the relative priorities of the alternatives. The operator has made a choice and the system is going to stick with it until and unless the operator makes a different choice (including choosing to go back to "auto mode").

"auto mode" is the default mode until the operator makes a manual choice.

Each set of alternatives (e.g. editor, awk, vi, pager, etc) has its own individual mode setting...in other words, making a manual choice for editor wont affect the mode of the vi or pager alternatives.

1
  • so what is the difference between "auto mode" and "default"? If there is none, then why not just use a simpler term? Also, if in manual mode the priority is meaningless, then what is the use of it?
    – Ooker
    Sep 20, 2023 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .