How to Disable Automatic Updates in Ubuntu

February 21, 2021 | 1 min read

Ubuntu has automatic updates enabled by default. Ordinarily, this is a convenient feature that helps our system stay up to date with the latest features, and protected with the newest security patches. However, on test systems or in edge cases, it can just be plain annoying.

In this article, we'll show you how to disable automatic updates in Ubuntu. This can be done from either GUI or command line, and we'll show you both methods in this guide.

Personally, we prefer to disable automatic updates on test machines in order to prevent the could not get lock error, which is caused by trying to use the package manager to install software when the system is already using the process to check for updates.

Could not get lock error on Ubuntu

Disable Automatic Updates via GUI

1. First, open up the "Software & Updates" utility.

Opening software & updates utility on Ubuntu

2. Head over to the "updates" tab and change the "automatically check for updates" option to never. Once you've made the changes, you can close this window.

Disabling automatic updates in software updates utility

Disable Automatic Updates via Command Line

1. Update preferences are stored in the /etc/apt/apt.conf.d/20auto-upgrades file. Open it with nano or your favorite text editor to make some changes to it.

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

2. To disable automatic updates completely, make sure all these directives are set to "0". When done, save your changes and exit the file.

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

Editing the automatic upgrades file

That's all there is to it. Now you won't need to worry about Ubuntu holding the apt package manager hostage when you try to use it. Upgrades and package downloads are now under your complete control, so don't forget to manually update your system every once in a while.