20

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.

  • 2
    Be careful as I think that some security fixes (e.g. new kernel?) won't take effect until the next reboot. – AdamS Jul 18 '17 at 18:55
26

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

4

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?

  • 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 Aug 11 '16 at 9:53
  • @Anwar Okay, I intended to point to related info, but I agree that the first link could be confusing. Wrt. your second point, though the question includes Or how to stop it updating packages altogether? – Tijn Porcelijn Aug 11 '16 at 10:03
  • 1
    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. – Anwar Aug 11 '16 at 10:07
  • 1
    @AnwarShah Thanks for the suggestions! Hope it's clearer after last edits – Tijn Porcelijn Aug 11 '16 at 10:10
  • I believe you'd want to apt-get purge to kill unattended-upgrades in its entirety, not just apt-get remove. – Reid Jul 26 '18 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.