Difference between auto mode and manual mode in update-alternatives

1,299

Solution 1

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

Solution 2

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.

Share:
1,299

Related videos on Youtube

Lee
Author by

Lee

Updated on September 18, 2022

Comments

  • Lee
    Lee almost 2 years

    Is it possible to trigger changes to CSS of an element that is completely unrelated to the hovered div?

    I have a CSS hover effect on a dropdown menu, that I also want to trigger the opacity of a div right at the bottom of the page to create a background overlay effect.

    This is the CSS I'm using:

    #overlay {
        background:rgba(0,0,0,0.5);
        position:absolute;
        top:120px;
        left:0;
        z-index:0;
        height:120%;
        width:100%;
        visibility:hidden;
        opacity:0;
    }
    #menu-main-menu li.menu-parent-item:hover ul.sub-menu,
    #menu-main-menu li.menu-parent-item:hover #overlay {
        visibility:visible;
        opacity:1;
    }
    

    The hover of the sub menu works fine, but the div #overlay is right at the bottom of the page, and doesn't get called when it's hovered.

    I've tried all kinds of alternatives such as :hover > #overlay, :hover + #overlay, but nothing seems to trigger it. I also can't seem to find a definitive answer to the question.

    Is it possible?

    • Karim AG
      Karim AG over 9 years
      You cannot achieve this using CSS, if you do not have to use a CSS only solution then javascript is your best friend.
    • Luuuud
      Luuuud over 9 years
      Please post your HTML, so we can actually see if it's possible in this case.
    • Lee
      Lee over 9 years
      @LuudJacobs It's hard to enter HTML, as this is a wordpress menu, so contains lots of code. using * as the css selector after the submenu, but the overlay disappears whenever I hover over margin of any child elements. (like submenus)
    • Paulie_D
      Paulie_D over 9 years
      Unless the overlay div and the target div share a common parent AND the overlay div comes after the target element then there is no CSS selector that will do this for you.
    • Lee
      Lee over 9 years
      The only parent they share is body, and it does come after the menu.. not directly after, but it is after.
    • Josh Burgess
      Josh Burgess over 9 years
      Is the menu the only thing in #menu-main-menu? And you want the overlay displayed whenever they're interacting with the menu?
    • Lee
      Lee over 9 years
      The menu is #menu-main-menu
  • Lee
    Lee over 9 years
    This looks good, although it's not making any changes to the overlay div when I apply it to my site. In my example I'm using #menu-main-menu > li as the hover line, and the overlay is also using an ID. Would this affect it at all? By the way, #menu-main-menu is the ID of the initial ul of the whole menu.
  • hungerstar
    hungerstar over 9 years
    Yes, you would have to configure things to your own needs. So the jQuery selector would be $('#menu-main-menu > li').hover(...) or simply $('#menu-main-menu').hover(...) and and instead of $('.overlay') use $('#overlay').
  • Lee
    Lee over 9 years
    Yeah that's what I did, and it doesn't make the overlay display at all. I'll come back to it, and will let you know.
  • hungerstar
    hungerstar over 9 years
    There could easily be other elements and CSS that might effect the display of your overlay. Without seeing the current working HTML/CSS it's hard to rule out or see if that is the issue. Do you know how to use developer tools in Chrome, Firefox etc.?
  • Lee
    Lee over 9 years
    Yeah I do, I'll come back to it when I'm next looking at the menu.
  • hungerstar
    hungerstar over 9 years
    Cool, I would make sure that you can see the CSS display property switching on #overlay and go from there. If you do see it switching when hovering your menu then you know the jQuery is working and that the issue is most likely other CSS or even the CSS of #overlay that is causing a display issue. Otherwise refine the jQuery selector.
  • baudo2048
    baudo2048 about 8 years
    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.
  • heemayl
    heemayl about 8 years
    @baudo2048 Example added..hope it will help you to understand..
  • Upe
    Upe about 8 years
    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.