NAME
unattended-upgrades — Ubuntu's automatic security updates: a daily systemd timer refreshes the package lists and runs unattended-upgrade, which installs packages from the allowed origins (the security pockets by default) and can reboot the machine if you let it.
kind: system daemon · package: unattended-upgrades (installed by default on Ubuntu) · binary: /usr/bin/unattended-upgrade, a Python 3 script run daily by apt-daily-upgrade.service through /usr/lib/apt/apt.systemd.daily; ps truncates the name to unattended-upgr. A second, long-lived python3 process, unattended-upgrade-shutdown --wait-for-signal, is the unattended-upgrades.service that waits to finish a run cleanly at shutdown · config: /etc/apt/apt.conf.d/20auto-upgrades (on/off and frequency), /etc/apt/apt.conf.d/50unattended-upgrades (origins, blacklist, reboot, mail), apt-daily.timer and apt-daily-upgrade.timer (schedule) · updated 2026-10-20
SAFE TO KILL?
SYMPTOMS
· apt or dpkg fails with 'Could not get lock /var/lib/dpkg/lock-frontend' first thing in the morning: the apt-daily-upgrade run is in progress
· python3 unattended-upgrade at high CPU with dpkg and apt children for minutes: it is installing updates
· the server rebooted by itself at a fixed hour: Unattended-Upgrade::Automatic-Reboot is true and Automatic-Reboot-Time is set
· a python3 process named unattended-upgrade-shutdown that never exits: the shutdown waiter, idle and normal
DIAGNOSE
FIX
1. Watch the run finish instead of fighting the lock. The dpkg log shows package by package progress. On a slow VM a kernel update plus initramfs rebuild takes a few minutes; the lock clears by itself.
$ tail -f /var/log/unattended-upgrades/unattended-upgrades-dpkg.log2. Move the run to an hour nobody is working. In the override put a [Timer] section with an empty OnCalendar= line (to clear the packaged schedule) followed by OnCalendar=*-*-* 03:00 and a short RandomizedDelaySec=. The Ubuntu docs also suggest Persistent=false in the same override if you do not want a missed run to catch up at the next boot.
$ sudo systemctl edit apt-daily-upgrade.timer3. Keep the updates, lose the surprise reboots. Unattended-Upgrade::Automatic-Reboot is "false" by default; if you enable it, set Unattended-Upgrade::Automatic-Reboot-Time to a quiet hour ("03:30"), and set Unattended-Upgrade::Mail with MailReport "on-change" or "only-on-error" so you hear about it.
4. Turn it off on machines you update by hand. Set both APT::Periodic::Update-Package-Lists "0" and APT::Periodic::Unattended-Upgrade "0" in /etc/apt/apt.conf.d/20auto-upgrades; sudo dpkg-reconfigure -plow unattended-upgrades asks the same question (unattended-upgrades/enable_auto_updates) interactively. Leaving security updates off on an internet-facing box is a decision, not a default.
IMPOSTORS
DISTRIBUTIONS
ubuntu Installed and enabled by default on Server and Desktop; Allowed-Origins covers the release pocket plus -security and the ESM security pockets; logs under /var/log/unattended-upgrades/. Desktop also runs update-notifier, which is a different thing.
APPLIES TO
unattended-upgrades 2.x on Ubuntu 20.04 and later with systemd timers; configuration keys from the Ubuntu Server docs on 2026-10-20.
SEE ALSO
SOURCES
1. Ubuntu Server docs — Automatic updates, fetched 2026-10-20
Machine-readable: /process/unattended-upgrades.json · changelog 2026-10-20: first version