Free and open source · Apache-2.0
unattended-upgrades-check: prove auto-patching works on every server
12 read-only checks over SSH that show whether unattended-upgrades or dnf-automatic is really installing security updates, on one server or a whole fleet.
unattended-upgrades-check (uuc) is a free, open-source (Apache-2.0) command-line tool that tells you whether unattended-upgrades or dnf-automatic is really installing security updates. It runs 12 read-only checks over SSH on Ubuntu, Debian, AlmaLinux and Rocky Linux servers and gives each server PASS, WARN or FAIL, with the reason and the fix.
“Installed and enabled” isn't “patching”. An empty allowed-origins list, a masked timer, apply_updates = no, a dpkg lock, a held package or a reboot nobody did all look fine until you check. Nothing is installed on the servers, no root is needed, and nothing on them is changed.
pipx install git+https://github.com/HostCrust/unattended-upgrades-check@v1.0.0
uuc check web-01 web-02
- License
- Apache-2.0
- Version
- 1.0.0 (November 14, 2026)
- Runs on
- Linux, macOS
- Needs
- Python 3.9+ and SSH. Nothing installed on the servers
- Written in
- Python
What is unattended-upgrades-check?
unattended-upgrades-check is a small Python command, uuc, that audits the automatic-update setup on Linux servers from your own machine. For each server it pipes a read-only POSIX shell script over SSH, reads back plain text, and applies 12 checks. Is the tool installed, scheduled and allowed to install security updates? Is it succeeding, free of package-manager errors and not blocked by held packages? Are security updates waiting? Are reboots, service restarts and the running kernel up to date, and is the OS release still supported? Each check comes back PASS, WARN, FAIL or SKIP, and every problem comes with the reason and the command that fixes it. It checks 10 servers at a time by default, writes a terminal table, a self-contained HTML report, JSON and a Prometheus textfile, and returns exit codes for cron. Version 1.0.0 came out on November 14, 2026 under the Apache-2.0 license. It needs Python 3.9 or newer and nothing else.
Why does unattended-upgrades stop working without telling you?
Because every link in the chain can fail on its own, and none of them alerts anyone. On Debian and Ubuntu, automatic patching is a chain: a systemd timer starts apt, apt refreshes the package lists, unattended-upgrades picks the packages whose origin is on its allow list, dpkg installs them, and the fixed code only runs after the service restarts or the server reboots. On AlmaLinux and Rocky Linux, dnf-automatic does the same job, and its default setting, apply_updates = no, only downloads updates. Each of these breaks one link: a masked timer, a config file that sets a periodic value back to “0”, an origin pattern written for Debian's old security suite name, a dpkg lock left by an interrupted run, a package held years ago, or a reboot nobody schedules. The package still shows as installed and the service still looks enabled, so the server simply stops getting fixes.
The 12 checks, and how each one fails silently
| # | Check | What it reads (apt / dnf) | How it fails silently | Result |
|---|---|---|---|---|
| 1 | Installed | The unattended-upgrades / dnf-automatic package | Minimal and custom images often ship without it | FAIL if missing |
| 2 | Scheduled to run and install | Both apt timers and the two APT::Periodic values / the dnf-automatic timers and apply_updates | A timer is disabled or masked, a periodic value is "0", or dnf-automatic only downloads | FAIL if it never installs; WARN if less than daily |
| 3 | Security updates allowed | Allowed-Origins / Origins-Pattern, matched against the archives apt knows / upgrade_type | An empty or outdated origins list installs nothing; Ubuntu Pro ESM enabled but not allowed | FAIL if no security archive matches; WARN for ESM |
| 4 | Last successful run | apt's stamps, the unattended-upgrades log / the dnf-automatic service result | The job runs and fails every day, or the package lists stop refreshing | WARN after 2 days, FAIL after 7 or if the last run failed |
| 5 | Package manager errors | dpkg --audit, interrupted dpkg state, log and journal errors from 14 days | “dpkg was interrupted” blocks every later install | FAIL for dpkg state; WARN for log errors |
| 6 | Held or excluded packages | apt-mark showhold, Package-Blacklist / versionlock, exclude= | A hold added for one upgrade years ago keeps a package unpatched for good | WARN |
| 7 | Security updates waiting | apt list --upgradable / dnf -C updateinfo list --security, local cache only | Updates are available but skipped | WARN; on apt, FAIL if they were already waiting at the last successful run |
| 8 | Reboot required | /var/run/reboot-required and since when / dnf needs-restarting -r | The fixed kernel or libc is installed, but nobody reboots | WARN, FAIL after 7 days |
| 9 | Services needing restart | needrestart -b / dnf needs-restarting -s | Long-running services keep the old library in memory | WARN |
| 10 | Running kernel | uname -r against the newest kernel in /boot | A newer kernel is installed but not running | WARN, FAIL after 7 days |
| 11 | Live kernel patching | /sys/kernel/livepatch, canonical-livepatch status, kpatch list | Livepatch is installed but not enabled | WARN if off; SKIP if not used |
| 12 | OS end of life | /etc/os-release against bundled endoflife.date data | The job works perfectly, but the release no longer gets fixes | FAIL after the date; WARN within 180 days |
SKIP means a check doesn't apply (for example, kernel checks in a container) or a tool it needs is missing; it never changes a server's overall result. The manual version of checks 1 to 4 and 7 is in our guide to setting up unattended-upgrades and proving it works. For held packages, see “The following packages have been kept back”.
What did it report on our two test servers?
Both servers came out FAIL, and that was the right answer. On November 14, 2026 (UTC) we ran uuc 1.0.0 from a Mac against two HostCrust test servers that had been set up and fully patched earlier that day: web-01 runs Debian 12.15 with unattended-upgrades, and web-02 runs AlmaLinux 9.8 with dnf-automatic. Everything up to the install step passed on both: the tool is installed, the timers are on, and only security updates are allowed. What failed was the proof. On web-01, unattended-upgrades was installed at 16:45 UTC, seconds after that day's apt timers had already fired, so no run is on record yet. On web-02, dnf-automatic.timer has never fired. A setup that has never completed a run hasn't shown that it works, so uuc fails it rather than assuming. The first real runs were due the next morning, at 06:01 and 06:20 UTC.
$ uuc check web-01 web-02 --html uuc.html --json uuc.json --prometheus uuc.prom
FAIL web-01 (Debian GNU/Linux 12 (bookworm))
PASS Auto-update tool installed unattended-upgrades 2.9.1+nmu3 is installed
PASS Scheduled to run and install apt-daily timers on; lists refreshed and upgrades run daily; next upgrade run in 11 h
PASS Security updates allowed security updates are allowed from Debian/oldstable-security
FAIL Last successful run no successful unattended-upgrades run on record
fix: sudo unattended-upgrade --dry-run --debug; see /var/log/unattended-upgrades/unattended-upgrades.log
PASS Package manager errors dpkg state is clean; no errors in the last 14 days
PASS Held or excluded packages no held or excluded packages
PASS Security updates waiting no security updates waiting
PASS Reboot required no reboot required
WARN Services needing restart 5 service(s) still run replaced library code: ssh.service, systemd-logind.service, systemd-manager, systemd-timesyncd.service, systemd-udevd.service
fix: sudo systemctl restart ssh.service systemd-logind.service systemd-manager systemd-timesyncd.service systemd-udevd.service
PASS Running kernel running the newest installed kernel, 6.1.0-54-amd64
SKIP Live kernel patching no live patching in use (optional: kernel fixes then need a reboot)
PASS OS end of life security support until 2028-06-30 (endoflife.date, 2026-11-14)
FAIL web-02 (AlmaLinux 9.8 (Olive Jaguar))
PASS Auto-update tool installed dnf-automatic 4.14.0-34.el9_8.alma.1 is installed
PASS Scheduled to run and install dnf-automatic.timer is on and installs updates; next run in 11 h
PASS Security updates allowed upgrade_type = security: installs updates that have a security advisory
FAIL Last successful run dnf-automatic.service has never run (no timer trigger on record)
fix: sudo journalctl -u dnf-automatic.service -n 50
PASS Package manager errors no dnf-automatic errors in the last 14 days
PASS Held or excluded packages no versionlocks or excludes
PASS Security updates waiting no security updates waiting (from the local dnf cache)
PASS Reboot required no reboot required
WARN Services needing restart 1 service(s) still run replaced library code: firewalld.service
fix: sudo systemctl restart firewalld.service
PASS Running kernel running the newest installed kernel, 5.14.0-687.66.2.el9_8.x86_64
SKIP Live kernel patching no live patching in use (optional: kernel fixes then need a reboot)
PASS OS end of life security support until 2032-05-31 (endoflife.date, 2026-11-14)
2 host(s): 2 FAIL
We checked the FAIL by hand on web-01. The package log and the timer show the order of events:
$ grep ' install unattended-upgrades' /var/log/dpkg.log
2026-11-14 16:45:15 install unattended-upgrades:all <none> 2.9.1+nmu3
$ systemctl list-timers apt-daily.timer apt-daily-upgrade.timer
NEXT LEFT LAST PASSED UNIT ACTIVATES
Sun 2026-11-15 00:39:42 UTC 6h left Sat 2026-11-14 16:45:02 UTC 1h 47min ago apt-daily.timer apt-daily.service
Sun 2026-11-15 06:01:30 UTC 11h left Sat 2026-11-14 16:44:53 UTC 1h 47min ago apt-daily-upgrade.timer apt-daily-upgrade.service
Two more details in that output are worth reading:
- The WARN is real. OpenSSL was reinstalled on web-01 a minute after its last boot, and
/proc/<pid>/mapsconfirms thatsshd,systemd-logindand the others still map the deleted, replacedlibcrypto.so.3. Restart them in a quiet moment.systemd-manageris needrestart's name for systemd itself, not a unit you can restart;sudo systemctl daemon-reexecre-executes it in place. - “oldstable-security” is correct for Debian 12. Debian 12 has been oldstable since Debian 13 was released, and its security updates still come from that archive.
Without root, three checks on web-01 lose some detail, and uuc says which. We ran the collector as the unprivileged nobody user, saved its output and checked it with uuc parse. The last-run check fell back to apt's stamp files and became a WARN (output trimmed to the limited checks):
$ uuc script | ssh web-01 'runuser -u nobody -- sh -s' > web-01.txt
$ uuc script | ssh web-02 'runuser -u nobody -- sh -s' > web-02.txt
$ uuc parse web-01.txt web-02.txt
WARN web-01 (Debian GNU/Linux 12 (bookworm))
...
WARN Last successful run apt recorded no successful unattended-upgrades run
fix: sudo unattended-upgrade --dry-run --debug; see /var/log/unattended-upgrades/unattended-upgrades.log
limited: the unattended-upgrades log needs root or the adm group; used the stamp files only
...
SKIP Services needing restart no restart needed among the processes visible without root
limited: without root only your own processes are checked
...
(not run as root: 3 check(s) limited; use --sudo for full results)
How do I check a whole fleet?
Name the servers, or point uuc at a list. Hosts are anything ssh accepts, and your SSH config, keys and agent are used as usual:
uuc check web-01 web-02 db-01 # names, user@host or ~/.ssh/config aliases
uuc check -f hosts.txt # one host per line, # comments allowed
uuc check --ssh-config # every Host alias in ~/.ssh/config (patterns skipped)
uuc check -f hosts.txt -j 20 --sudo # 20 at a time; sudo -n, which never prompts
uuc check db-01 -o Port=2222 # extra ssh -o options
It checks 10 hosts at a time by default, with a 120-second limit per host (--timeout); our two servers took 5 seconds in total. Exit codes make it easy to schedule: 0 when every host is OK, 1 for a warning, 2 for a failure, and 3 when a host couldn't be checked (a failure still returns 2). A daily cron job that writes a report and a Prometheus textfile looks like this:
15 7 * * * uuc check -f /etc/uuc/hosts --html /var/www/uuc.html --prometheus /var/lib/node_exporter/uuc.prom >/dev/null
Already collecting data with your own tooling? Print the collector with uuc script, run it any way you like, and check the saved files later with uuc parse. The file name becomes the host label.
What do the HTML, JSON and Prometheus outputs look like?
HTML (--html) is one self-contained file: a host-by-check matrix at the top, then each server's checks with the reason and the fix. For our two servers it was 10 KB, with no scripts or stylesheets loaded from elsewhere.
JSON (--json FILE, or --json - for stdout) has the same results for scripts. One check from web-01:
{
"id": "last-run",
"title": "Last successful run",
"status": "FAIL",
"reason": "no successful unattended-upgrades run on record",
"fix": "sudo unattended-upgrade --dry-run --debug; see /var/log/unattended-upgrades/unattended-upgrades.log",
"limited": null
}
Prometheus (--prometheus FILE) writes a textfile for node_exporter's textfile collector. An excerpt from the same run:
# HELP uuc_host_status Overall result per host: 0 ok, 1 warn, 2 fail, 3 error.
# TYPE uuc_host_status gauge
uuc_host_status{host="web-01"} 2
uuc_host_status{host="web-02"} 2
uuc_check_status{host="web-01",check="last-run"} 2
uuc_check_status{host="web-01",check="services"} 1
uuc_pending_security_updates{host="web-01"} 0
uuc_reboot_required{host="web-01"} 0
uuc_kernel_outdated{host="web-01"} 0
The full set is uuc_host_status, uuc_check_status, uuc_pending_security_updates, uuc_reboot_required, uuc_kernel_outdated, uuc_last_success_timestamp_seconds (left out while a host has no successful run), uuc_os_eol_timestamp_seconds and uuc_collected_timestamp_seconds, each with a host label. Alert on the collected timestamp as well as the status, so a cron job that stopped can't hide a problem.
Is dnf-automatic not working? What it checks on AlmaLinux and Rocky Linux
Usually dnf-automatic is installed but set only to download. The DNF documentation gives apply_updates a default of false, so the plain dnf-automatic.timer fetches updates and installs nothing, and upgrade_type defaults to default, meaning every update rather than security fixes only. Four timers ship with it. Only dnf-automatic.timer follows the config file; dnf-automatic-install.timer installs whatever apply_updates says, -download only downloads, and -notifyonly only reports. Check that a timer is enabled at all: on our AlmaLinux 9.6 test image, right after dnf install dnf-automatic, every one was disabled. To fix it, set apply_updates = yes (plus upgrade_type = security if you want security fixes only) and enable dnf-automatic.timer, or enable dnf-automatic-install.timer instead. Then confirm the first run worked with systemctl list-timers 'dnf-automatic*' and journalctl -u dnf-automatic.service. This is the packaged config and timer state we captured on that image:
$ grep -E '^(upgrade_type|apply_updates)' /etc/dnf/automatic.conf
upgrade_type = default
apply_updates = no
$ systemctl list-unit-files "dnf-automatic*.timer"
UNIT FILE STATE PRESET
dnf-automatic-download.timer disabled disabled
dnf-automatic-install.timer disabled disabled
dnf-automatic-notifyonly.timer disabled disabled
dnf-automatic.timer disabled disabled
Installed, and nothing will ever be patched. uuc reports that as a FAIL on check 2 and prints the fix. On web-02, which uses apply_updates = yes, upgrade_type = security and dnf-automatic.timer, checks 2 and 3 passed. For reboots and restarts on the RHEL family it reads dnf needs-restarting -r and -s.
How does it compare with Landscape, check_unattended_upgrades, PatchMon and needrestart?
They do more than uuc, and some of them patch for you; uuc is a quick check that needs nothing installed. Landscape is Canonical's management product for Ubuntu estates, with a client on each machine. The Nagios plugin suits teams that already alert from Nagios or Icinga. PatchMon is an always-on dashboard and patching platform with an agent on every host. needrestart does one of the 12 checks, the restart part, and can perform the restarts itself; uuc reads needrestart -b for check 9 when it's installed. Choose Landscape or PatchMon when you want a system that applies patches and keeps a history, the Nagios plugin when alerts must land in the monitoring you already run, and uuc when you want an answer today without installing anything. We haven't tested whether Landscape or PatchMon check the auto-update job itself (timers, origins, last result). Every cell below comes from each project's own page, checked in November 2026.
| Tool | What it is | Checks the auto-update job | Reboot, restarts, kernel | What it needs | Where it's stronger |
|---|---|---|---|---|---|
| unattended-upgrades-check 1.0.0 | Read-only checker; Apache-2.0 | Yes: timers, periodic values, origins, last run, errors, holds | Yes, plus Livepatch and OS end of life | Python on your machine and SSH; nothing on the servers | Narrow by design: checks only, no patching, no dashboard |
| Landscape | Canonical's management for Ubuntu: patching, auditing, access management, compliance | Not described on its product page | Not described on its product page, which lists Livepatch | Landscape Client on each machine; server self-hosted or managed; available with Ubuntu Pro | Central patching and compliance for an Ubuntu estate |
| check_unattended_upgrades | Nagios and Icinga plugin; Python, MIT | Yes: time since last run, dry run, security setup, apt timers, APT::Periodic values, custom repos | Reboot required (-R) | Runs on each Debian or Ubuntu host it monitors | Fits existing Nagios/Icinga alerting with fine-grained thresholds |
| PatchMon | Open-source patch monitoring and management platform; AGPL-3.0 | Not described in its README | Reports kernel and uptime per host | A Go agent on each host, a server with PostgreSQL and Redis | Always-on dashboard, approved patch runs, apt, dnf, yum, apk, pacman and FreeBSD |
| needrestart | Finds daemons still using outdated libraries, plus obsolete kernels and microcode; GPL-2.0 | No | Yes, and it can restart the services | Installed on each host | Actually restarts services; interpreter and container detection |
uuc tells you whether the patching job works. To see which CVEs are still open on a server once it does, taking distro backports into account, use Patch Proof.
What are the limits?
- Supported: Ubuntu 20.04 and later, Debian 11 and later, AlmaLinux 8 and later, Rocky Linux 8 and later. Other apt and dnf systems run, but the end-of-life check is skipped.
- Testing so far: synthetic fixtures for all four distributions, a real Ubuntu 24.04 server before release, and the Debian 12 and AlmaLinux 9.8 servers on this page.
- “Security updates waiting” is only as fresh as the server's package lists. The report shows how old they are. On apt it counts upgradable packages from a
-securityarchive, so the number can differ from what unattended-upgrades would pick. - Systems without systemd: the timer checks are skipped and the report says so. Cron-only setups aren't checked.
- Live patching: KernelCare and similar products aren't detected, except through
/sys/kernel/livepatch. - End-of-life dates are bundled (endoflife.date, retrieved November 14, 2026) and never fetched at run time. Update the tool to refresh them, and see our Linux end-of-life dates guide.
- The suggested fix for services passes every name to
systemctl restart, including needrestart'ssystemd-manager, which needssystemctl daemon-reexecinstead (see the test output above).
When check 8 or 10 fails, our guides on checking the running kernel version and on rebooting a server and confirming it came back cover the next step.
Changelog
1.0.0, November 14, 2026. First release. uuc check HOST... runs 12 read-only checks over SSH and says whether unattended-upgrades (Debian, Ubuntu) or dnf-automatic (AlmaLinux, Rocky Linux) is really installing updates: timers and periodic settings, allowed origins matched against the configured security archives, last successful run, dpkg errors, held packages, security updates waiting, reboot required and since when, services needing restart, running against newest kernel, Livepatch and kpatch, and OS end of life from bundled endoflife.date data. Output: a terminal table, one self-contained HTML file, JSON, a Prometheus textfile, and exit codes 0, 1, 2 and 3. Python 3.9 or newer, standard library only.
How we checked this: unattended-upgrades-check 1.0.0, installed from the v1.0.0 tag into a Python 3.14 virtual environment on macOS, run over SSH on 14 Nov 2026 (UTC) against two test servers addressed by SSH aliases: Debian 12.15 (unattended-upgrades 2.9.1+nmu3) and AlmaLinux 9.8 (dnf-automatic 4.14.0-34.el9_8.alma.1), as root and, through uuc parse, with the collector run as the unprivileged nobody user. We confirmed the two FAIL results by hand from dpkg.log and systemctl list-timers. The packaged dnf-automatic defaults come from our AlmaLinux 9.6 baseline capture. We did not run Landscape, PatchMon, check_unattended_upgrades or needrestart as separate products. Anything we didn't run ourselves comes from the official documentation listed under Sources.
Check which CVEs are really open on your server
HostCrust Patch Proof compares every installed package with your distribution's own security data. It counts fixes your distro backported and checks the kernel that is actually running, not just the one on disk. Read-only, no root, free.
FAQ
How do I check if unattended-upgrades is working?
Check five things on the server: apt-daily.timer and apt-daily-upgrade.timer are active; apt-config dump shows APT::Periodic::Update-Package-Lists "1" and APT::Periodic::Unattended-Upgrade "1"; the allowed origins include your -security archive; /var/log/unattended-upgrades/unattended-upgrades.log shows a recent run that ended without errors; and apt list --upgradable shows no security updates left waiting. uuc check does all of that, plus the reboot, restart, kernel and end-of-life checks, for every server at once.
Why does unattended-upgrades say “No packages found that can be upgraded unattended”?
Either nothing is waiting, which is good, or the allowed origins don't match your security archive, which is bad. Tell them apart with apt list --upgradable 2>/dev/null | grep -- -security. If that lists packages, the origins are wrong or the packages are held. An old Debian pattern written for <codename>/updates stopped matching when Debian 11 renamed the security suite to <codename>-security.
Why isn't dnf-automatic installing updates?
Most often because apply_updates defaults to no in /etc/dnf/automatic.conf, so dnf-automatic.timer only downloads. Set apply_updates = yes, or enable dnf-automatic-install.timer, which installs whatever the setting says. Also check the timer is enabled at all: on our AlmaLinux 9.6 test image every dnf-automatic timer was disabled after install.
Where is the unattended-upgrades log?
/var/log/unattended-upgrades/unattended-upgrades.log records each run's decisions and errors, and unattended-upgrades-dpkg.log in the same folder has the dpkg output. The systemd side is in journalctl -u apt-daily.service -u apt-daily-upgrade.service, and every apt transaction is in /var/log/apt/history.log. The log folder is readable only by root and the adm group.
Does unattended-upgrades-check change anything on my servers?
No. The collector never runs apt update, dnf makecache, an install or a restart. apt runs with its on-disk cache file turned off and dnf runs cache-only (-C); when run as root, dnf may append to its own log in /var/log. A test in the repository fails the build if a command that could change a server is added to collect.sh.
Does it need root?
No. Most checks work as a normal user. Reading the unattended-upgrades log, the journal and other users' processes needs root or the adm group, and the report names each check that was limited. --sudo runs the collector with sudo -n, which never prompts for a password.
Sources
- unattended-upgrades-check v1.0.0: README (checks, usage, metrics, limits)
- unattended-upgrades-check: v1.0.0 release
- unattended-upgrades upstream README (options, origins, Automatic-Reboot)
- Ubuntu Server documentation: Automatic updates
- Ubuntu Pro Client: how to interpret unattended-upgrades output
- Debian 11 release notes: the security suite is now named <codename>-security
- Debian releases (Debian 12 is oldstable since Debian 13)
- DNF documentation: dnf-automatic (apply_updates, upgrade_type, timers)
- systemctl manual: daemon-reexec
- needrestart on GitHub (outdated libraries, kernels and microcode; batch mode)
- check_unattended_upgrades: Nagios and Icinga plugin
- PatchMon on GitHub (agent and server, AGPL-3.0)
- Canonical Landscape
- Prometheus node_exporter: textfile collector
- endoflife.date (bundled end-of-life data)