How to Stop Automatically Installing Updates on Ubuntu or Debian (Unattended Upgrade)

Debian and Ubuntu -based Linux distributions can automatically install the latest security (and other) updates using packages named. unattended-upgrades .
By default, this unattended upgrade package is already installed on Ubuntu (but not on Linux Mint) and Debian 9+ with Gnome, although it is a nice feature, quite some user Complaining about it, and installing the update without user input, is similar to Microsoft Windows-like behavior. Especially when you want to shut down or restart the system urgently, you will get the following information:

This applies not only to Ubuntu with Gnome, but also to other Ubuntu versions including Kubuntu, Ubuntu MATE, etc.
As a side note, if you force shutdown / reboot while installing the update, your computer may fail to boot to Ubuntu / Debian, and apt may get corrupted, showing E: Could not get lock /var/lib/dpkg/lock Either E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem People who want to get rid of this automatic installation of updates using Gnome on Ubuntu or Debian 9+ have two options: delete unattended-upgrades Or configure it so that updates are not installed automatically.

  • Remove unattended upgrades from Ubuntu or Debian.

Remove unattended-upgrades The package does not remove any other packages on Ubuntu or Debian, so it can be safely removed.
It looks like the unattended upgrade is installed on Ubuntu by default as it is the suggested dependency python3-software-properties (A package that can easily add a PPA repository), Ubuntu will automatically install the recommended packages.
You can delete the unattended upgrade package using the following methods:

                        sudo apt remove unattended-upgrades
  • Disable automatic installation of security (and other) updates on Ubuntu or Debian.

You can also choose to disable the installation of automatic updates. This can be done by issuing the following command:

                        sudo dpkg-reconfigure unattended-upgrades

Then select No When asked if you want to download and install updates automatically: Disable the unattended upgrade of Ubuntu

For more information on unattended upgrades, including blacklisting certain packages or changing update schedules, see Auto update Ubuntu Server Guide section, and Unattended upgrade Debian Wiki page.


Related Posts