13

16.04 Xenial

APT automatic update check: enabled

APT automatic update download & install: disabled

No cron jobs listed below,

$ for user in $(cut -f1 -d: /etc/passwd); do sudo crontab -u $user -l; done

The system suddenly topped by heavy load pertaining to both CPU and Network IO from the aroused unattended-upgrade for several minutes.

Why could it happen when automatic update download & install were totally disabled?

sof
  • 497
  • 1
  • 4
  • 15
  • 3
    A better question is why does it hammer the CPU. Disabling it is just a work-around for a bigger issue. I'm getting this on 18.04 VM this morning. Running 100% for about 10 mins when booted. Now at about 25% for last 20 mins. Reminds me of Windows updates. – B. Shea Sep 22 '19 at 12:12
  • @bshea Its actually worse than Windows updates. – Rolf Mar 01 '21 at 10:02
  • 1
    The high CPU usage is a known bug. I posted a solution to this here: https://askubuntu.com/a/1359119/1060743 – stackprotector Aug 20 '21 at 11:22
  • @stackprotector Do we know why was that answer downvoted? – Stewart Feb 08 '22 at 09:58
  • 1
    @Stewart A user stated, that the solution did not work for him. I was able to reproduce the problem inside a VM and to solve it by my solution (which does not disable unattended upgrades in contrast to many other solutions). – stackprotector Feb 08 '22 at 10:20

2 Answers2

18

The functionality on unattended-upgrades is automatically enabled after the installation of 16.04 Xenial Server. I mistakenly didn't really disable it so observed the unexpected behaviors above. Method Two here I had followed is unlikely effective.

To properly disable the automatic updates, we need change the configuation on /etc/apt/apt.conf.d/20auto-upgrades from:

APT::Periodic::Unattended-Upgrade "1";

to:

APT::Periodic::Unattended-Upgrade "0"; 
sof
  • 497
  • 1
  • 4
  • 15
14

If your OS uses systemd then:

sudo systemctl mask unattended-upgrade.service

would also stop it from automatically running.

The main issue I have is: why is it taking up 100% CPU for downloading some files?

Rolf
  • 1,911
  • 1
  • 15
  • 12