How to Enable or Disable Automatic Updates on Ubuntu Linux

office 4694143 640
office 4694143 640

This tutorial highlights the process of enabling automatic updates on Ubuntu servers for security reasons. It recommends installing the Ubuntu Auto Upgrade Package using specific commands. After installation, users are directed to adjust settings in the 50unattended-upgrades file, manage unwanted packages, and further configure parameters. Completion of the process results in Ubuntu installing updates automatically.

This brief tutorial shows students and new users how to enable automatic updates in Ubuntu.

Setting up a Ubuntu server to update automatically sounds good. The question is, how does one accomplish it?

To keep your data and server secure, it’s recommended that you routinely update your servers. Ubuntu is no different.

You leave your servers open to hackers and intruders without installing security patches or software updates. So, go and update your servers.

If you don’t have all the time in the world to do that on Ubuntu servers, follow the guide below to configure Ubuntu to automatically install security updates and patches.

You won’t have to worry again about patching Ubuntu.

Install the Ubuntu Auto Upgrade Package

To configure Ubuntu to update automatically, you must install its upgrade/update package. To do that, run the commands below.

sudo apt-get update
sudo apt-get install unattended-upgrades

Configure Ubuntu to automatically update

After installing the package above, please navigate to the file below and open it with your favorite editor.

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

Then look for the lines below and adjust according to your needs

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {

If you wish to block other packages from updating automatically, configure the section below:

// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
// "libc6-dev";
// "libc6-i686";

You can configure other parameters, like rebooting the server automatically after installing and more. Just remove the double slashes // on each line to enable a particular setting.

Save the file when you’re done.

Finally, please navigate to the file below and open it with your favorite editor.

sudo nano /etc/apt/apt.conf.d/10periodic

Then, edit the lines as shown below.

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

Save the file, and you’re done.

This is how you configure Ubuntu to install updates automatically


Posted by

I love computers; maybe way too much. What I learned I try to share at

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.