Stop Ubuntu from running Auto Upgrades at boot – #DEVOPS

Hits: 3957

Devops need to automatically install stuff on Ubuntu, however this clashed with the daily ubuntu auto update.

The best way to stop autoupgrades is to prevent Ubuntu from download the updated package list

Edit /etc/apt/apt.conf.d/20periodic or whatever number it is

Change the 1 for Update-Package-Lists to a 0

APT::Periodic::Update-Package-Lists “0”;
APT::Periodic::Unattended-Upgrade “1”;


Other advice to kill the proccess that I did not follow:

The advice given at the link at the bottom is to kill the daily process, then run your devops. The Ubuntu daily will run later anyway.



systemctl stop apt-daily.service
systemctl kill --kill-who=all apt-daily.service

# wait until `apt-get updated` has been killed
while ! (systemctl list-units --all apt-daily.service | fgrep -q dead)
  sleep 1;

# now proceed with own APT tasks
apt install -y python

I am running with docker-machine so leave out the install at the end if your using docker-machine.

I haven’t tried this yet, but plan to.

Source: systemd – How to disable `apt-daily.service` on Ubuntu cloud VM image? – Unix & Linux Stack Exchange