Ubuntu security updates: how to list what is missing

How to list the missing security updates on an Ubuntu server: the apt, unattended-upgrades and pro commands, what each shows, and what they miss.

The short answer: refresh the package lists, list the upgradable packages and keep the ones that come from the -security pocket. That works for one server. Below is each built-in command, what its output means and what it does not show.

Step 1: refresh the package lists

sudo apt update

apt update downloads package information from all configured sources. Skip it and every command below reads an old cache. At the end it prints a hint such as 19 packages can be upgraded. Run 'apt list --upgradable' to see them.

List the upgradable packages

apt list --upgradable

Two lines from the example in Ubuntu's own server documentation:

bind9-dnsutils/resolute-updates,resolute-security 1:9.20.18-1ubuntu2.1 amd64 [upgradable from: 1:9.20.18-1ubuntu2]
bpftool/resolute-updates 7.7.0+7.0.0-22.22 amd64 [upgradable from: 7.7.0+7.0.0-15.15]

Read each line as: package, the pockets that offer the new version, the new version, the architecture, and the installed version. resolute is the release codename in that example. On 22.04 you see jammy, on 24.04 noble.

The apt man page lists the option as --upgradeable. The --upgradable spelling is the one apt itself prints in its hint, and both are used in Ubuntu's documentation.

Tell security updates apart: the -security pocket

Ubuntu publishes a released update to one of two pockets: -security for security fixes, -updates for the rest. So filter on the pocket name:

apt list --upgradable 2>/dev/null | grep -- -security

In the example above, bind9-dnsutils is a security update and bpftool is not. Two notes:

  • A fix can sit in both pockets, as bind9-dnsutils does. It still counts as a security update.
  • 2>/dev/null hides apt's warning that its command line interface is not stable for scripts. The man page says the same: apt may change behavior between versions. In scripts, prefer apt-get.

Simulate the upgrade with apt-get

apt-get -s dist-upgrade | grep '^Inst'

-s (also --simulate, --dry-run, --just-print) shows what would happen without changing the system. Each output line is one dpkg operation: Inst (unpack), Conf (configure) or Remv (remove). Unlike upgrade, dist-upgrade also handles changed dependencies and may remove some packages, so the simulation shows the full set of actions. It does not mark which ones are security fixes.

Ask unattended-upgrades what it would install

sudo unattended-upgrade --dry-run --debug

--dry-run simulates the run. --debug writes extra output to /var/log/unattended-upgrades/unattended-upgrades.log. Ubuntu's server guide uses sudo unattended-upgrade -v --dry-run for the same check.

This is useful because it applies the same allowed origins as the automatic job. In the default /etc/apt/apt.conf.d/50unattended-upgrades those are the release pocket, -security, and the Ubuntu Pro security pockets (-infra-security and -apps-security). -updates is commented out. The result is close to "the security updates this server would install on its own".

Check support status with pro security-status

pro security-status
pro security-status --esm-infra
pro security-status --esm-apps
pro security-status --thirdparty
pro security-status --unavailable

pro security-status groups the installed packages by where their security coverage comes from:

  • main/restricted: covered during the LTS period, and longer with esm-infra.
  • universe/multiverse: covered by esm-apps.
  • esm-infra and esm-apps: pending and applied Pro updates, for example "There are 170 pending security updates".
  • Third party: packages from outside the Ubuntu archive, such as PPAs.
  • Unavailable: packages no longer available for download, for example from an older release or a local .deb.

The pending ESM updates matter. Those fixes exist only in Ubuntu Pro, so apt upgrade on a server without Pro cannot install them.

You may also find ubuntu-security-status in older guides. On a system with the pro command it prints "This command has been replaced with 'pro security-status'." and runs that instead.

Map updates to advisories: USNs and OVAL

Canonical issues an Ubuntu Security Notice (USN) when a security issue is fixed in an official package. The list at ubuntu.com/security/notices shows each notice with the affected releases and its CVE ids. Ubuntu's CVE pages (https://ubuntu.com/security/CVE-...) show the status per release.

For a machine-readable check of one host, Canonical publishes USN OVAL data per release:

wget https://security-metadata.canonical.com/oval/com.ubuntu.$(lsb_release -cs).usn.oval.xml.bz2
bunzip2 com.ubuntu.$(lsb_release -cs).usn.oval.xml.bz2
oscap oval eval --report report.html com.ubuntu.$(lsb_release -cs).usn.oval.xml

This needs the oscap tool on the host and gives one HTML report for that host.

Kernels: installed is not running

uname -r
ls /var/run/reboot-required

After a kernel update is installed, apt list --upgradable no longer shows it, but the old kernel keeps running until you reboot. uname -r prints the running kernel. After a kernel install Ubuntu shows a pending reboot notice; the file /var/run/reboot-required is that notice. Livepatch, part of Ubuntu Pro, can patch some kernel issues without a reboot.

The limits of doing it by hand

CommandShowsDoes not show
apt list --upgradableNew versions and their pocketCVEs, Pro-only fixes on hosts without Pro
apt-get -s dist-upgradeEvery install and removalWhich ones are security fixes
unattended-upgrade --dry-runWhat the automatic job would installCVEs per update
pro security-statusCoverage and pending ESM updatesPer-CVE detail
USN pages, OVALAdvisories and CVEsNothing across many servers

In practice:

  • One server at a time. Each command runs on one host. Ten servers means ten logins and ten outputs to merge.
  • No CVE list per update. apt shows versions, not the CVEs a version closes. You look those up in the USN.
  • Kernels installed but not running. A clean apt list can still mean a vulnerable kernel until the reboot.
  • Ubuntu Pro only fixes. Without Pro attached, apt does not see them. Only pro security-status tells you they exist.

How Openness does it

Openness is an open source vulnerability scanner for Linux and Windows servers. For Ubuntu it does the same comparison as the commands above, for many servers at once:

  • Credentialed scan over SSH. Add a target, attach an SSH key or password and start the scan. Use a dedicated read-only account; some checks need sudo without a password for read commands.
  • Installed packages against Canonical's own data. Openness reads the installed packages and compares them with Canonical's USN OVAL data for that release, downloaded from security-metadata.canonical.com. It lists the CVEs Canonical ties to the installed release, not every CVE in a notice.
  • The fix, not only the problem. Each finding names the Ubuntu advisory, the installed version and the fixed version. Update cards group the packages to update with their target versions and the CVEs each update closes.
  • Ubuntu Pro (ESM) marked. Fixes that exist only in Ubuntu Pro are marked, so you know why a finding stays open after apt upgrade.
  • Kernel packages included. On our Ubuntu 22.04 comparison host, the largest finding was a kernel update. Openness reports the package update; use uname -r after the reboot to confirm the new kernel runs.
  • Supported Ubuntu releases: 20.04, 22.04, 24.04, 26.04 and 26.10. 22.04 is verified on a real host; the others are covered by recorded test data, and the result page says so. A server on any other release is reported as not checked, never as clean.

The free plan covers 20 servers in 90 days, allows commercial use, and includes every scan, report and export.

Next steps

This post was written by an AI model (Claude) and published by S4E.io. Found a mistake? Tell us.

All posts · This page as Markdown

Star on GitHub