Unattended upgrades not upgrading: check these in order
apt list --upgradable shows a screen of packages, unattended-upgrades has been
installed for months, and little seems to change. Before assuming it is broken, check what it
is configured to do. The defaults cover less than the name suggests.
Work down the list. Confirm apt-daily-upgrade.timer fires and
/etc/apt/apt.conf.d/20auto-upgrades sets both periodic values to "1". Then read
the allowed origins. Ubuntu installs security updates only and Debian adds point releases.
Neither touches -updates or third-party repositories unless you add them. Run
sudo unattended-upgrade --dry-run --debug and read
/var/log/unattended-upgrades/. Holds, blacklist entries, configuration-file
prompts, new dependencies and dpkg locks explain most of the rest.
Defaults on Debian 13 and Ubuntu 24.04
We checked the defaults against Debian 13 with unattended-upgrades 2.12 and apt 3.0.3, and Ubuntu 24.04 LTS with unattended-upgrades 2.9.1+nmu4ubuntu1 and apt 2.8.3.
| Debian 13 | Ubuntu 24.04 | |
|---|---|---|
| Installed out of the box | Depends on how the system was installed; the Debian wiki warns it may be missing | Yes, with security updates enabled |
| 20auto-upgrades | Written with both values set to "1" when the package is installed, because its setup question defaults to yes | Present, both values "1" |
| Installs from | trixie-security, plus the trixie release itself, which only changes at point releases | noble-security, ESM security where available, and the release pocket for new dependencies |
| Ignores by default | trixie-updates, backports, every third-party repository | noble-updates, backports, proposed, PPAs, every third-party repository |
| Schedule | Upgrade timer at 06:00 server time, plus up to 60 minutes random delay | Same |
| Automatic reboot | Off | Off |
The checklist
- It is switched onRun
apt-config dump | grep Periodic. You wantUpdate-Package-Lists "1"andUnattended-Upgrade "1". Both default to 0 in apt's daily script, so a missing20auto-upgradesmeans nothing runs, andAPT::Periodic::Enable "0"in any file switches everything off.sudo dpkg-reconfigure -plow unattended-upgradeswrites the file if it never existed, but not if someone deleted it. In that case ucf printsNot replacing deleted config fileand leaves it missing. Run it assudo UCF_FORCE_CONFFMISS=1 dpkg-reconfigure -plow unattended-upgrades, or copy/usr/share/unattended-upgrades/20auto-upgradesback into place. - The timers fire
systemctl list-timers apt-daily.timer apt-daily-upgrade.timershows the last and next run, andjournalctl -u apt-daily-upgrade.serviceshows what happened. A disabled or masked timer means no runs, whatever the configuration says. - apt itself is healthyBefore anything else, apt's daily script runs
apt-get check, which takes the dpkg lock, and exits quietly if it fails. That includes the state an interrupted install leaves behind, where apt will not take its lock until someone runsdpkg --configure -a. One power cut mid-upgrade can stop every later run without a word. Runsudo apt-get checkyourself. If it complains,sudo dpkg --configure -afinishes the interrupted install andsudo apt-get -f installrepairs broken dependencies. - The package comes from an allowed originEach run in the log starts with
Starting unattended upgrades script, followed byAllowed origins are:. Compare that list withapt-cache policy <package>, which shows which archive the new version sits in. On Ubuntu a version innoble-updatesis not allowed by default, and neither is anything from Docker, a PPA or any other repository you added. - Run it by hand
sudo unattended-upgrade --dry-run --debugsimulates a run and writes its reasoning to/var/log/unattended-upgrades/unattended-upgrades.log. The directory is readable by root and the adm group only. A dry run cannot list kept-back packages, and says so. For that, read the log of a real run. - Nothing is on hold
apt-mark showholdlists held packages. unattended-upgrades leaves them alone, and a real run, not a dry run, logsPackage <name> is marked to be held back. - The blacklist is not too broad
Package-Blacklistentries are Python regular expressions matched from the start of the name, so"linux-"blocks every kernel package. A blacklisted package also blocks upgrades of packages that depend on it. A real run logsPackage <name> is blacklisted.for the package itself, but onlyis kept back because a related package is kept backfor the packages that depend on it. - No configuration-file prompt is waitingIf an upgrade would ask whether to keep your edited configuration file, the package is skipped and the log says
has conffile prompt and needs to be upgraded manually. Upgrade it by hand and answer the question. - It does not need a removalunattended-upgrades installs new dependencies only from allowed origins and never removes an installed package to complete an upgrade.
apt upgradealso skips an upgrade that needs a removal. Ubuntu 24.04's apt lists it under "kept back", and Debian 13's apt 3.0 lists it under "Not upgrading". Unlike unattended-upgrades,apt upgradedoes install new dependencies from any configured repository. Read whatsudo apt full-upgradeproposes to remove before you accept it. - Phasing only holds back apt upgradeUbuntu releases some updates in stages. APT decides per machine from the package name, version and
/etc/machine-id, andapt upgradeholds the new version back until your share comes up.apt policy <package>shows it as, for example,(phased 20%). Security updates are never phased. APT has done this since Ubuntu 21.04 and apt 2.1.16. unattended-upgrades does not apply phasing. In our test it installed an update phased at 0% as soon as its origin was allowed. Phasing can explain whyapt upgradeholds something back, but it does not explain why unattended-upgrades does. If you allow-updates, phased updates reach the machine straight away. - Nothing else holds the lockA run that collides with you or a configuration tool using apt gives up until the next day. If unattended-upgrades itself meets the lock, it logs
Lock could not be acquired (another package manager running?). The reverse often happens after boot. The timers are persistent, so a run missed while the machine was off starts after it comes up, subject to the same random delay.aptwaits for it to finish, andapt-getstops at once withCould not get lock.
Letting it install more than security updates
The unattended-upgrades README recommends putting changes in a separate file that sorts after
50unattended-upgrades, so package updates to the shipped file do not collide
with your edits. Lists in a later file add to the stock list rather than replacing it:
// /etc/apt/apt.conf.d/52unattended-upgrades-local
// Ubuntu: also install bug-fix updates, not only security
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-updates";
};
// Debian uses Origins-Pattern instead:
// Unattended-Upgrade::Origins-Pattern {
// "origin=Debian,codename=${distro_codename}-updates";
// };
For a third-party repository, find its Origin in the repository's InRelease file
under /var/lib/apt/lists/ or in apt-cache policy output, and add it
the same way. Decide separately whether you want vendor packages updating themselves at six
in the morning.
Run schedule and run time
apt-daily.timer, which refreshes package lists, fires at 06:00 and 18:00 with up to
12 hours of random delay. apt-daily-upgrade.timer installs at 06:00 with up to 60
minutes of delay. The APT::Periodic values are intervals in days, checked against
stamp files by calendar date, so each step still happens once a day and a value below one day
does not make it run more often. To run twice a day, set the value to always and
add a second OnCalendar line. To move the run:
sudo systemctl edit apt-daily-upgrade.timer
# in the editor that opens:
[Timer]
OnCalendar=
OnCalendar=*-*-* 03:00
RandomizedDelaySec=30m
There is no typical run time to quote, because it depends on what is waiting. By default the
upgrade runs in minimal steps, which the shipped configuration describes as a bit slower but
safe to interrupt at shutdown. To measure your own, compare the log timestamp on
Starting unattended upgrades script with the one on the last line of each run.
Reboots and kernel updates
A new kernel package installs like any other, and the running kernel stays as it was until
the machine reboots or
live patching applies the fix. unattended-upgrades does not decide
whether a reboot is needed. It looks for /var/run/reboot-required and, with
automatic reboot on, reboots when that file exists:
// /etc/apt/apt.conf.d/52unattended-upgrades-local
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "03:30";
unattended-upgrades passes the time to shutdown as given, and it uses the
server's time zone. The
default is now, which means straight after the run, and it reboots with users
logged in unless you set Automatic-Reboot-WithUsers to false. On both Debian and
Ubuntu, unattended-upgrades itself installs a kernel hook,
/etc/kernel/postinst.d/unattended-upgrades, that writes the flag file whenever a
kernel package is installed. Ubuntu's update-notifier-common adds another. On
Ubuntu, both skip it for kernels while Canonical Livepatch is enabled. The flag file covers
kernels only. Running services keep the old copy of a library in memory until they restart.
From Ubuntu 24.04, needrestart restarts affected services automatically by
default when apt runs it. Debian's version defaults to asking, and when it runs without a
terminal, as during an unattended upgrade, it only lists them.
"Unattended-upgrade in progress during shutdown"
The package ships a small service, unattended-upgrades.service, that does
nothing until the machine shuts down. If an upgrade is running at that moment, it sends the
upgrade a stop signal, writes this message to unattended-upgrades-shutdown.log
and to the shutdown splash screen where there is one, and holds shutdown while the current
step finishes, for up to 25 minutes by default. Let it finish. Cutting power mid-install can
leave dpkg half-configured, and from then on apt installs nothing, the daily job included,
until someone runs sudo dpkg --configure -a, which is step three above.
InstallOnShutdown does the opposite and installs updates during shutdown
instead of in the background. It is off by default, makes every shutdown slower, and
the shipped configuration advises raising logind's InhibitDelayMaxSec if you
enable it. On a server that rarely shuts down it is the wrong tool.
Automatic security updates are step five of securing a new VPS. The checklist above tells you whether step five is happening.
Gotchas
- A healthy-looking timer that does nothing. The official Ubuntu 24.04 Docker image ships
/etc/apt/apt.conf.d/docker-disable-periodic-updatecontainingAPT::Periodic::Enable "0". The timers were listed and enabled, andapt-daily-upgrade.servicefinished with "Deactivated successfully", yet the run wrote no stamp file or log line. Any image or configuration tool can do the same, so checkapt-config dump | grep Periodicfor anEnableline before trusting the timer. - Deleting 20auto-upgrades is sticky. After we removed the file,
dpkg-reconfigure -plow unattended-upgradesprintedNot replacing deleted config fileand left it missing, because ucf treats a deleted configuration file as the administrator's choice.UCF_FORCE_CONFFMISS=1in front of the command recreated it. - An interrupted dpkg looks like a lock problem. We killed dpkg during a package's configure step. From then on
apt-daily-upgrade.servicestill reported success and nothing reached the unattended-upgrades log, and a manualunattended-upgradeloggedLock could not be acquired (another package manager running?)although nothing else was running. Its built-in repair,AutoFixInterruptedDpkg, never ran, because it only runs after the lock is taken.sudo dpkg --configure -afixed it. SettingAPT::Periodic::Verbose "1"makes the daily job writeerror encountered in cron job with "apt-get check"to the journal instead of failing silently. - Phased updates do not slow unattended-upgrades down. APT deferred a test update phased at 0%, but unattended-upgrades installed it on both Debian 13 and Ubuntu 24.04 as soon as its origin was allowed. On Debian it also scheduled a 50% update that APT was deferring for that machine. If you add
-updateson Ubuntu, expect updates beforeapt upgradewould offer them. - Automatic reboot follows the flag file, not the run. With
Automatic-Reboot "true"and/var/run/reboot-requiredpresent, unattended-upgrades calledshutdown -rat the end of a run that had installed nothing. A kernel you installed by hand earlier in the day therefore gets its reboot at the next unattended run.
How this was tested. On 23 September 2026 we worked through every step above in Docker containers running systemd. One ran Debian 13 from the debian:trixie image with unattended-upgrades 2.12 and apt 3.0.3, and one ran Ubuntu 24.04.5 LTS with unattended-upgrades 2.9.1+nmu4ubuntu1 and apt 2.8.3. A local repository of dummy packages produced a hold, blacklist hits, a configuration-file prompt, new dependencies from allowed and disallowed origins, an upgrade needing a removal, and updates phased at 0% and 50%. We killed dpkg mid-install, held the dpkg lock, fired the timers, stopped unattended-upgrades.service during a slow install to simulate shutdown, installed a real Debian kernel package, and replaced shutdown with a logging stub to test automatic reboot. Not tested: a real reboot or power cut, real phased updates from the Ubuntu archive, ESM origins, mail reports, or what a fresh Ubuntu Server installation ships, since the Docker images do not include unattended-upgrades.
Sources
- unattended-upgrades README, unattended-upgrades project, GitHub
- unattended-upgrade(8) manual page, Debian 13, unattended-upgrades 2.12
- unattended-upgrades 2.12 source: 50unattended-upgrades.Debian, unattended-upgrade, unattended-upgrade-shutdown, debian/templates, Debian
- 50unattended-upgrades.Ubuntu, unattended-upgrades 2.9.1+nmu4ubuntu1, Ubuntu
- apt 3.0.3 source: apt.systemd.daily, apt-daily.timer, apt-daily-upgrade.timer, Debian
- UnattendedUpgrades (PeriodicUpdates), Debian Wiki, last modified 10 July 2026
- stable-updates, Debian Wiki
- Automatic updates, Ubuntu Server documentation
- About apt upgrade and phased updates, Ubuntu Server documentation, updated 26 June 2026
- apt_preferences(5): Phased Updates, Debian 13
- apt(8) and apt-mark(8), Debian 13
- systemd.timer(5), Debian 13
Questions
How often do unattended upgrades run?
Once a day by default. On Debian and Ubuntu, apt-daily-upgrade.timer fires at 06:00 server time with up to 60 minutes of random delay, and apt-daily.timer, which refreshes package lists, fires at 06:00 and 18:00 with up to 12 hours of delay. The APT::Periodic values in 20auto-upgrades are intervals in days, so with the default of 1 each step still happens once per day. Because the timers are persistent, a run missed while the machine was off happens shortly after the next boot.
How do I enable unattended upgrades?
Install the unattended-upgrades package, then run sudo dpkg-reconfigure -plow unattended-upgrades and answer yes. That writes /etc/apt/apt.conf.d/20auto-upgrades with APT::Periodic::Update-Package-Lists and APT::Periodic::Unattended-Upgrade both set to "1". If the file was deleted after installation, dpkg-reconfigure will not recreate it unless you run it as sudo UCF_FORCE_CONFFMISS=1 dpkg-reconfigure -plow unattended-upgrades. Check the result with apt-config dump, and test with sudo unattended-upgrade --dry-run --debug. On Ubuntu Server both steps are already done after installation.
Why are packages kept back and not upgraded automatically?
unattended-upgrades skips a package when the new version is in a repository that is not an allowed origin, such as Ubuntu -updates or a third-party repository; when it is held with apt-mark or matches Package-Blacklist; when its upgrade would ask about a changed configuration file; or when it needs a package removed or a dependency from a disallowed origin. On Ubuntu, phased updates hold non-security updates back from apt upgrade for a while, but in our tests unattended-upgrades itself ignored phasing.
How long does an unattended upgrade take?
There is no fixed duration. It depends on how many packages are waiting and what their install scripts do. By default it installs in minimal steps, which is slightly slower but can be interrupted safely. To see your own timings, compare the start and finish lines in /var/log/unattended-upgrades/unattended-upgrades.log, or read journalctl -u apt-daily-upgrade.service.
What does "unattended-upgrade in progress during shutdown" mean?
You shut down while an upgrade was running. The unattended-upgrades shutdown helper asks the running upgrade to stop after its current step and delays shutdown while it finishes, for up to 25 minutes by default. Let it finish rather than cutting power. If dpkg is interrupted anyway, run sudo dpkg --configure -a, because until you do apt installs nothing, and the daily job stops at its first check.
The free server review checks whether updates get applied and what gets skipped. Pricing.