Ubuntu: Disable Automatic Updates
- May 1st, 2020
- Posted in Documentation
- Write comment
UPDATE: What outlined below did not work, so here is what I ended up doing:
Change directory to:
$ cd /etc/apt/apt.conf.d
Edit the 20auto-upgrades, and change the Lists setting from 1 to 0:
$ sudo vi 20auto-upgrades
APT::Periodic::Update-Package-Lists “0”;
APT::Periodic::Unattended-Upgrade “1”;
Now, with the list disabled the service should never find anything to update.
Another option is just get rid of the service:
$ sudo apt remove unattended-upgrades
Note: The following did not work in Ubuntu 18.x:
For reason, I don’t know if this an Azure deployment issue or an Ubuntu decision, but I have found automatic updates turned on by default in a couple VMs. Not sure why you would ever want your production server automatically updating, so:
Check to status of the unattended-upgrades service:
$ sudo systemctl status unattended-upgrades
Stop the service:
$ sudo systemctl stop unattended-upgrades
Disable the service. NOTE: Services that have this as a dependency will start the service despite it being disabled. I am not aware of any for this service, but just putting it out there.
$ sudo systemctl disable unattended-upgrades
To prevent the unintended situation above, mask will create a link to /dev/null to prevent the service from being started whether there are dependencies or not.
$ sudo systemctl mask unattended-upgrades
No comments yet.