How can I stop unattended-upgrades from rebooting the machine?

27,142

Solution 1

Verify that in the configuration file: /etc/apt/apt.conf.d/50unattended-upgrades you have set:

Unattended-Upgrade::Automatic-Reboot "false";

This will prevent the software to issue reboot also if needed by the upgrades.

Documentation

Solution 2

To disable automatic upgrades altogether, just remove the package. Try:

sudo apt-get remove unattended-upgrades

See Ubuntu docs for more info. However, if you want to keep the package and configure its behaviour, see this question's solution How do I enable automatic updates?

Share:
27,142

Related videos on Youtube

user1814016
Author by

user1814016

Updated on September 18, 2022

Comments

  • user1814016
    user1814016 over 1 year

    I just had a look at my Amazon EC2 instance and noticed I had 20 minutes exactly of downtime. I didn't know what caused it so I logged in to SSH and tried upgrading my packages, and saw that the unattended-upgrades package needed upgrading. I went ahead and did this.

    After searching it seems like this package can automatically reboot your machine. Not sure why I didn't get to configure this as it came with the OS, but oh well.

    Does anyone know how to prevent the package from automatically rebooting? Or how to stop it updating packages altogether? I can do that myself.

    • AdamS
      AdamS almost 7 years
      Be careful as I think that some security fixes (e.g. new kernel?) won't take effect until the next reboot.
  • Anwar
    Anwar over 7 years
    You first link's most voted answer suggest installing it and you're suggesting to remove it? Again, removing it beats the purpose of getting automatic unattendend upgrades altogether!
  • Anwar
    Anwar over 7 years
    You may only extract that information out to point OP to the right direction? Since, it is confusing to see supporting link saying against (at first look at least) the answer.
  • Tijn Porcelijn
    Tijn Porcelijn over 7 years
    @AnwarShah Thanks for the suggestions! Hope it's clearer after last edits
  • Reid
    Reid almost 6 years
    I believe you'd want to apt-get purge to kill unattended-upgrades in its entirety, not just apt-get remove.
  • Serrano Pereira
    Serrano Pereira over 5 years
    Down vote, because removing unattended-upgrades is usually a bad idea. You will miss out on important security updates, especially considering this is a server instance, where you want these to be installed automatically.
  • Radio Controlled
    Radio Controlled over 2 years
    Is this directly active or is it required to reboot or export some variables, etc?