On an Ubuntu server, you often see messages such as “N updates are security updates” in apt output or in the MOTD. But that message does not tell you which vulnerabilities (CVEs) the updates fix. It also does not tell you whether a kernel update needs a reboot. Ubuntu publishes its security fixes as Ubuntu Security Notices (USNs). This post explains what a USN is and how to find and apply pending security updates.
What is a USN?
The Ubuntu Security Team publishes an Ubuntu Security Notice (USN) each time a security fix for a package in the archive is released. One USN lists the related CVEs, the affected packages, and the fixed versions. For example, a set of kernel vulnerabilities is published together under one number, such as USN-8493-1. You can search all notices at ubuntu.com/security/notices, also by CVE number.
The fixes are published in the security pocket, separate from the other pockets of the release. In /etc/apt/sources.list.d/ubuntu.sources (or the older sources.list), each release has a separate <codename>-security suite.
$ grep -A2 "noble-security" /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Check for pending security updates
The basic method is to run apt update and then filter the upgradable packages that come from the security pocket.
sudo apt update
apt list --upgradable 2>/dev/null | grep -i security
If the Ubuntu Pro Client (ubuntu-advantage-tools, installed by default on current releases) is available, pro security-status shows much more detail. The command also runs on a machine that is not attached to a Pro subscription. The output below, with the counts of updates from esm-infra and esm-apps, is from an attached machine.
$ pro security-status
559 packages installed:
554 packages from Ubuntu Main/Restricted repository
5 packages from Ubuntu Universe/Multiverse repository
This machine is attached to an Ubuntu Pro subscription.
Main/Restricted packages are receiving security updates from
Ubuntu Pro with 'esm-infra' enabled until 2028. You have received 121 security
updates.
Universe/Multiverse packages are receiving security updates from
Ubuntu Pro with 'esm-apps' enabled until 2028. You have received 1 security
update.
The output shows that security updates for Universe/Multiverse packages need the esm-apps service. Ubuntu Pro is free for personal and small-scale use on up to 5 machines.
Check and fix a specific CVE or USN
If you know the CVE or USN number, pro fix tells you whether the system is affected and whether the fix is already installed. With --dry-run, it only shows the status and installs nothing.
$ sudo pro fix CVE-2023-5764 --dry-run
WARNING: The option --dry-run is being used.
No packages will be installed when running this command.
CVE-2023-5764: Ansible vulnerabilities
- https://ubuntu.com/security/CVE-2023-5764
1 affected source package is installed: ansible
(1/1) ansible:
A fix is available in Ubuntu Pro: ESM Apps.
The update is already installed.
✔ CVE-2023-5764 is resolved.
If the fix is not installed, run the command without --dry-run. You can also give a USN number (pro fix USN-8493-1).
sudo pro fix CVE-2023-5764
Without the Ubuntu Pro Client, a plain apt upgrade is enough to bring all packages to their latest security versions. It handles the security pocket and the updates pocket together.
sudo apt update && sudo apt upgrade -y
Automatic updates and kernel patches without a reboot
unattended-upgrades is installed by default, and it applies security updates daily with no extra configuration. To see which packages it would upgrade, run it in dry-run mode.
sudo unattended-upgrade --dry-run --debug
The log of applied updates is in /var/log/unattended-upgrades/unattended-upgrades.log. Kernel packages are the problem. A kernel security update installs, but it takes effect only after a reboot. These files show whether a reboot is required.
$ cat /var/run/reboot-required
*** System restart required ***
$ cat /var/run/reboot-required.pkgs
linux-image-6.14.0-29-generic
To apply kernel security fixes without downtime, use Canonical Livepatch. It patches the running kernel and fixes most kernel vulnerabilities without a reboot. It is part of Ubuntu Pro and is also free on up to 5 machines.
sudo pro enable livepatch
canonical-livepatch status --verbose
Cautions
- Do not expect Livepatch to cover every kernel vulnerability. Fixes that change kernel data structures a lot, and some driver fixes, cannot be applied as live patches. In these cases you still need a reboot.
- Enable esm-apps for Universe/Multiverse packages. If
pro security-statusshows 0 security updates for Universe/Multiverse on an attached machine, theesm-appsservice is often disabled. Enable it withsudo pro enable esm-apps. - Do not expect unattended-upgrades to install other updates. By default it applies only security updates. To include other updates, add the suite to
Unattended-Upgrade::Allowed-Originsin/etc/apt/apt.conf.d/50unattended-upgrades. On production servers, automate only security updates and test other updates before you apply them. - Give
pro fixan exact CVE or USN number. It cannot take a general description such as “kernel security issue”. Search ubuntu.com/security/notices by package or kernel version to find the number first.
Conclusion
Ubuntu organizes its security fixes as USNs. A single apt upgrade installs most of them. When you need to know which CVE was fixed and why, pro security-status and pro fix give a much clearer answer. Kernel fixes normally need a reboot, but on servers where downtime is costly, Livepatch can apply many of them without one.
This is a referral link. I may receive credit if you sign up, at no extra cost to you.
Try it on a cloud server — Deploy Ubuntu on VultrReferences
- Ubuntu Security Notices
- Security updates — Ubuntu security documentation
- Exploring your system’s security with Pro — Ubuntu Pro Client documentation