How to Disable Automatic Updates in Ubuntu

Regularly updating your applications is important to protect your system from vulnerabilities and keep it updated with the latest features and security patches.

In Ubuntu, automatic updates are enabled by default and keep your system updated without needing to manually update packages. Some users prefer to have manual control over updates as it gives them the flexibility to install updates according to their preferences.

Let’s see how you can disable automatic updates in Ubuntu.

Why Disable Automatic Updates on Ubuntu?

Manually updating your system regularly can be a time-consuming and tiresome task. Automatic update, also known as the Unattended Upgrade feature on Ubuntu makes this task easier. It automatically checks and installs security and other updates without any manual intervention.

It also has some drawbacks like it consumes bandwidth and resources which slow down your system and affect other processes, particularly during peak hours. By disabling automatic updates, you can have manual control over when and which update to run.

Furthermore, when you try to install some packages on Ubuntu while the automatic update is running in the background, you will receive an error stating "Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend."

This is quite irritating as it does not let you install the package until the update is finished. To prevent this from happening again, the only option you have is to disable automatic updates.

How to Disable Automatic Updates on Ubuntu

Automatic updates in Ubuntu are handled by the unattended-upgrades package which is preinstalled on most of the Ubuntu releases. To check if Unattended Upgrades is installed and running on your system, use the following command:

sudo systemctl status unattended-upgrades.service 

You can also check this by viewing the current configuration of Unattended Upgrades:

apt-config dump APT::Periodic::Update-Package-Lists
apt-config dump APT::Periodic::Unattended-Upgrade

If you see an output like below, it means the automatic update is enabled.

If the value of APT::Periodic::Update-Package-Lists and APT::Periodic::Unattended-Upgrade is "0", it means automatic updates are disabled.

To disable Unattended Upgrades on Ubuntu, run the following command:

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

This will open the configuration file in the Nano editor. Change the value of Update-Package-Lists and Unattended-Upgrade to 0:

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

Once done, save and close the file.

This would tell the system to disable the automatic downloading and installation of updates. After that, run the following commands to verify if the automatic updates are disabled:

apt-config dump APT::Periodic::Update-Package-Lists
apt-config dump APT::Periodic::Unattended-Upgrade

If they are, you would receive the following output:

In the future, if you want to re-enable automatic updates, open the /etc/apt/apt.conf.d/20auto-upgrades file and change the values of Update-Package-Lists and Unattended-Upgrade to 1.

If you want to permanently disable the automatic updates feature, run the following command:

sudo apt remove unattended-upgrades 

Disable Automatic Updates on Ubuntu Graphically

You can also disable automatic updates on Ubuntu graphically. To do so, press the Super key on your keyboard and type "software and updates." From the search results, select the Software & Updates option.

Under the Updates tab, you will see different options for update configuration. By default, it is configured to check for updates daily. If you do not want the system to automatically check for updates, set the value of Automatically check for updates to Never.

Similarly, change When there are security updates from Download and install automatically to Display immediately. This will let you know about any security updates as soon as they are available.

These settings only disable the system from checking the updates automatically. You can still check and install the updates manually whenever you want.

Installing Updates Manually on Ubuntu

To manually check and install updates on your system, run the following update and upgrade commands:

sudo apt update
sudo apt upgrade

You can also manually install updates on Ubuntu graphically using the Ubuntu Software Updater tool.

Package Updates Help Maintain System Security

While it is not recommended to disable automatic updates in any operating system, there may be some reasons you might want to do anyway.

Whatever the reason, you can now easily disable automatic updates in Ubuntu either through the command line or graphically. However, make sure to manually update your system and applications regularly to maintain system security and minimize the risk of breaches.

ncG1vNJzZmivp6x7rq3KnqysnZ%2Bbe6S7zGiboquRl7mmecCuq6ilkam2pHnUqZuarJWoeqq6jK6Zrqakqnw%3D