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
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.
#!/bin/bash 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) do sleep 1; done # 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.