Recently, I explained how you can enable auto updates in Ubuntu where the security updates will be installed without the intervention of a user.
However, some users may want to revert back to the previous state to have more control over the system for various reasons.
So in this tutorial, I will walk you through how you can stop Ubuntu auto-update.
Stop auto-update in Ubuntu
To stop auto-update, first, let's check if the
unattended-upgrades.service service which is responsible for auto-update is active or not:
systemctl status unattended-upgrades.service
If you see a similar result, it means the service is actively running so before you proceed any further, stop the service using the following:
sudo systemctl stop unattended-upgrades.service
Once done, open the auto-update configuration file using the following command:
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
And change the value of
APT::Periodic::Unattended-Upgrade to zero (0):
Save changes and exit from the nano text editor.
To verify the changes, use the following commands one by one:
apt-config dump APT::Periodic::Update-Package-Lists
apt-config dump APT::Periodic::Unattended-Upgrade
It should give you the following output:
From now on if you ever need the service up again, revert the changes you've made (change the 0 to 1 again as it was earlier).
Also, make sure to start and enable the service.
But if you don't plan to use this service again and want to uninstall it, then you can use the following command:
sudo apt remove unattended-upgrades
Here's how to set live patch in Ubuntu
Did you know that you can apply security patches without rebooting your device? Well, it is called live patching and we made a detailed guide explaining how to enable live patching in Ubuntu:
I hope you will find this guide helpful.