Disable Auto Updates (Unattended Upgrades) in Ubuntu

PowerADM.com / Linux / Ubuntu / Disable Auto Updates (Unattended Upgrades) in Ubuntu

On Ubuntu Server 18 and newer, the unattended-upgrades package is installed by default. This package is used to automatically install all updates or just security updates in Ubuntu.

#dpkg -l | grep unattended-upgrades

unattended-upgrades on ubuntu used to automatically install updates

It is thanks to this package that you may encounter this message when you shutdown/reboot Ubuntu:

Unattended-upgrade in progress during a shutdown, please don’t turn off the computer

ubuntu: Unattended-upgrade in progress during shutdown, please don’t turn off the computer

Automatic update check and installation settings in Ubuntu/Debian are configured in /etc/cron.daily/apt. The file is run from /etc/crontab by default at 06:25. So, if something breaks down around this time, you know who is to blame.

To completely remove the unattended-upgrade package and all of its components:

$ sudo apt-get -y remove unattended-upgrades
$ sudo systemctl stop apt-daily.timer
$ sudo systemctl disable apt-daily.timer
$ sudo systemctl stop apt-daily-upgrade.timer
$ sudo systemctl disable apt-daily-upgrade.timer
$ sudo systemctl disable apt-daily.service
$ sudo systemctl daemon-reload

Or, you can disable automatic updates for Ubuntu in the file:

$ sudo vi /etc/apt/apt.conf.d/20auto-upgrades

APT::Periodic::Unattended-Upgrade "0";
APT::Periodic::Update-Package-List "0";

If you do decide to configure automatic updates in Ubuntu through automatic updates, use the command:

$ sudo dpkg-reconfigure unattended-upgrades

configure unattended-upgrades on Ubuntu

In the /etc/apt/apt.conf.d/50unattended-upgrades file, you can specify which updates you want to install automatically:

Unattended-Upgrade::Allowed-Origins {
        "Ubuntu precise-security";
//      "Ubuntu precise-updates";
};

You can prevent the automatic update of certain packages:

Unattended-Upgrade::Package-Blacklist {
      "vim";
      "libc6";
      "libc6-dev";
//    "libc6-i686";
};

To enable automatic updates in apt settings, add the following options to the /etc/apt/apt.conf.d/20auto-upgrades file:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

With these settings, the Ubuntu server will check for updates and install them daily.

The unattended-upgrades log is stored in the /var/log/unattended-upgrades file.

11 thoughts on “Disable Auto Updates (Unattended Upgrades) in Ubuntu”
  1. Yes, that’s a good guide, it clearly explains how to set up Ubuntu’s unattended upgrades step-by-step. Really helpful for keeping your system secure while you take a break with a mobile game.

  2. Yes, that’s a good guide, it clearly explains how to set up Ubuntu’s unattended upgrades step-by-step. Really helpful for keeping your system secure while you take a break with a mobile game.

  3. This is a really helpful guide for anyone managing Ubuntu servers. I’ve had issues with automatic updates interrupting work before, so knowing how to control or disable unattended upgrades is great. On a different note, I recently tried the minecraft apk download latest version 2025 in my free time, and the new updates in the game are pretty awesome.

  4. Thanks for sharing this helpful guide on unattended upgrades in Ubuntu, super useful for keeping systems secure without manual effort. I usually save such references in camscanner pro apk so I can access them easily later.

Leave a Reply to Minecraft APK Cancel reply

Your email address will not be published. Required fields are marked *