10

I just migrated from CentOS to Ubuntu Server 16.04 LTS. I chose "no" when it asked me to do automatic updates during the setup. However, I just realized that by default unattended-upgrades is activated and installed by default, since it had installed a kernel update automatically. This is very Windows like and is disappointing me. Why is this the case that it is enabled by default even though the user chose no during the setup?

Thanks

  • AFAIK the setup is asking to download updates during the setup so it installs updates packages, not about activating or not "unattended-upgrades". – Javier Rivera Jun 10 '16 at 16:05
  • I was about to ask exactly that, it's like I have to remember for every fresh new xbuntu installation that I have to disable them. – David Tabernero M. Oct 10 '18 at 8:08
4

I can't explain why it gives you the option and then ignores your response. Without installing, I can't confirm that behaviour, however, it's easy to fix it.

Edit /etc/apt/apt.conf.d/50unattended-upgrades and comment out the -security line.

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
//      "${distro_id}:${distro_codename}-security";
//      "${distro_id}:${distro_codename}-updates";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};
| improve this answer | |
  • Good rule of thumb when overriding in conf.d areas: Better to always create a custom override file when possible. 99z-custom would work in this area I think (untested). When apt updates itself your 50unattended-upgrades files might be overwritten. Your custom file will not. – bshea Sep 22 '19 at 12:39
9

Another way to disable unattended upgrades is to

Edit /etc/apt/apt.conf.d/20auto-updates and set "Unattended-Upgrade" to "0".

APT::Periodic::Unattended-Upgrade "0";
| improve this answer | |
  • 2
    Isn't that file called 20auto-upgrades, not 20auto-updates? – hheimbuerger May 18 '18 at 20:31
  • 2
    Files from linux's *.d folders are read in alphanumeric order irrespective of their exact name. Thus, the answer will work as long as the name is alphanumerically bigger than "10periodic". – wedi Jul 29 '18 at 20:19
  • @wedi Yes - and this should be taken advantage of. It avoids a package overwriting your changes on system updates. You have to make sure when using any conf.d area that your custom directive(s) come LAST. The filename 20auto-updates if used as user-created new override file, would be read in BEFORE 20auto-upgrades. Last file read wins. Better idea on any conf.d area is to create something you know will be read DEAD LAST. Try creating 99z-custom in /etc/apt/apt.conf.d with the statement APT::Periodic::Unattended-Upgrade "0"; - it will be read last. Again: Last wins. – bshea Sep 22 '19 at 12:35

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.