Cyberithub

How to Enable or Disable Automatic Updates on Ubuntu/Debian Linux

Advertisements

In this article, we will see how to enable or disable Automatic updates on Ubuntu/Debian Linux. In almost all the famous linux distributions including Ubuntu/Debian Linux, you will find that by default update would be enabled to make sure system automatically download and install all the latest available updates. This saves lot of manual effort and keep the system secure from external vulnerabilities. While this seems to be working fine in most of the cases but still there are certain situations in which the automatic updates creates certain problem.

One of the basic problem is that if this policy is enabled on a Production system which generally runs critical applications of certain tested version, an automatic update might upgrade the version of running application or few dependent packages to the latest one which not be tested in lower environments. This may cause major issue and hence it is generally a good idea to keep the automatic update off in those systems. Here we will see the different ways through which you can enable or disable automatic update in your Ubuntu/Debian based systems.

 

How to Enable or Disable Automatic Updates on Ubuntu/Debian Linux

How to Enable or Disable Automatic Updates on Ubuntu/Debian Linux

Also Read: How to Install tree command on Ubuntu 20.04 LTS (Focal Fossa)

There are multiple ways to enable or disable automatic updates on Ubuntu/Debian based systems. You can do it through both GUI as well as CLI mode. Let's see both the methods so that you can choose whichever works best for you.

 

Method 1: Using GUI

To enable or disable updates from GUI, you need to search software & update in the search bar as shown below. Once it appears, tap on it to open.

How to Enable or Disable Automatic Updates on Ubuntu/Debian Linux 2

It should open like below. Here you need to go to Updates tab and set Automatically check for updates to Never from drop down as shown below. Then click on Close. This will allow you to disable automatic updates.

How to Enable or Disable Automatic Updates on Ubuntu/Debian Linux 3

If you want re-enable automatic updates then you can go to the same place and select the suitable option to check for automatic updates.

 

Method 2: Using CLI

If you are looking to enable automatic update on Ubuntu/Debian based systems using CLI mode then you need to set both of the option to 1 in /etc/apt/apt.conf.d/20auto-upgrades file as shown below.

cyberithub@ubuntu:~$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades 
APT::Periodic::Update-Package-Lists "1"; 
APT::Periodic::Unattended-Upgrade "1";

If you are looking to disable automatic update on Ubuntu/Debian based systems using CLI then you need to set Update-Package-Lists to 0 in /etc/apt/apt.conf.d/20auto-upgrades file as shown below.

cyberithub@ubuntu:~$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades 
APT::Periodic::Update-Package-Lists "0"; 
APT::Periodic::Unattended-Upgrade "1";

Similarly, if you want to disable Unattended Upgrade then you need to set it to 0 as shown below.

cyberithub@ubuntu:~$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades 
APT::Periodic::Update-Package-Lists "0"; 
APT::Periodic::Unattended-Upgrade "0";

If you would like to immediately enable or disable update then you need to run sudo dpkg-reconfigure unattended-upgrades command as shown below.

cyberithub@ubuntu:~$ sudo dpkg-reconfigure unattended-upgrades

You will see below dialog box where you need to select Yes or No to enable or disable automatic update immediately.

How to Enable or Disable Automatic Updates on Ubuntu/Debian Linux 4

Leave a Comment