SSD Nodes Learn Hosting plans →
Guides Matt ConnorBy Matt Connor

Security-only updates with dnf on Rocky/Alma

Read dnf updateinfo on Rocky or AlmaLinux, list only the security advisories, apply one advisory or one CVE fix, and know when the patch needs a reboot.

What dnf updateinfo tells you

dnf updateinfo reads the advisory metadata that your enabled repositories publish and matches it against the packages installed on your server. That metadata is what dnf upgrade --security uses to select fixes for known security problems; dependency resolution can also update other packages. On Rocky Linux 9 and AlmaLinux 9 the advisories are named RLSA and ALSA, the number matches the Red Hat advisory each rebuild came from, and dnf-automatic with upgrade_type = security runs exactly the same filter on a timer.

The manual workflow is short. Read the summary, list the security advisories, read one, preview the transaction, apply it, then decide whether to reboot.

dnf updateinfo
dnf updateinfo list --security
dnf updateinfo info ALSA-2025:2627
dnf check-update --security
sudo dnf upgrade --security
sudo dnf needs-restarting -r

Every command here except the two with sudo works as a normal user, because none installs or removes packages. The rest of this guide is what each step shows you, and what it means when a step shows nothing.

Where the updateinfo metadata comes from

A dnf repository is a directory of RPMs plus a repodata/ folder. The index file repodata/repomd.xml lists the metadata files the repository offers: the package list, the file lists, the comps groups, and, if the publisher provides it, a file of type updateinfo. That file, updateinfo.xml, is a list of advisories. Each advisory has an id, a type (security, bugfix, enhancement or newpackage), a severity, a description, the CVE ids it fixes, and the exact package versions that carry the fix.

dnf downloads updateinfo.xml with the rest of the metadata. It knows nothing about security on its own. If a repository publishes no updateinfo, its packages cannot be selected as security targets from that repository's advisory metadata, though dependency resolution can still bring them into a security transaction.

You can check what a repository offers without dnf. For Rocky Linux 9 BaseOS:

curl -s https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/repodata/repomd.xml | grep -A 4 'type="updateinfo"'

Run the same check against the AlmaLinux 9 BaseOS index at https://repo.almalinux.org/almalinux/9/BaseOS/x86_64/os/repodata/repomd.xml and any third-party repository you have added. A repomd.xml with no updateinfo element is the usual reason a package never shows up under --security.

On your own server, the downloaded copies sit in the dnf cache:

sudo dnf makecache
sudo find /var/cache/dnf -name '*-updateinfo.xml*'

One path per repository that publishes advisories. A repository with no line here contributes nothing to dnf updateinfo. EPEL does publish advisories, and they appear with a FEDORA-EPEL- prefix beside the RLSA or ALSA ones; EPEL and CRB on Rocky and AlmaLinux covers what else that repository changes.

Both distributions build updateinfo.xml from the Red Hat advisory that each rebuilt package came from. The Rocky Linux errata page in the release engineering docs says the data is generated by a system called Apollo, working with the Peridot build system, and its errata browser link points to errata.build.resf.org; errata.rockylinux.org also serves the Rocky Linux errata site. The AlmaLinux errata documentation says its advisories are published at errata.almalinux.org, as updateinfo.xml in the repositories and mirrors, and also as JSON and OVAL files for scanners.

Read the summary with dnf updateinfo

dnf updateinfo

With no arguments the command prints a summary of the advisories that apply to newer versions of packages you have installed. That is the available view, and it is the default. The Rocky errata page shows this output from one of its own hosts (a Rocky 8 box, so the versions end in el8; yours end in el9):

Updates Information Summary: available
    1 New Package notice(s)
    5 Security notice(s)
        4 Important Security notice(s)
        1 Moderate Security notice(s)
    1 Bugfix notice(s)
    1 Enhancement notice(s)
Security: kernel-core-4.18.0-372.19.1.el8_6.x86_64 is an installed security update
Security: kernel-core-4.18.0-372.9.1.el8.x86_64 is the currently running version

Read the counts first. They count advisories, and one advisory usually covers several packages, so five security notices can mean twenty package updates. The indented lines split the security notices by severity, which is the value you will use later with --sec-severity.

The two Security: lines at the end appear when a kernel carrying a security advisory is installed but the server is still running an older kernel. Someone applied the update and never rebooted. That is the reboot question this guide returns to at the end.

Four words change which advisories the summary counts. available is the default. installed counts advisories for versions equal to or older than the installed versions, so it tells you which advisory fixes your installed versions cover. updates counts only advisories where an upgrade exists. all counts every advisory that names any version of an installed package. dnf updateinfo installed is how you answer the question "did we already patch that".

List only the security advisories

dnf updateinfo list --security

list prints one line per package per advisory. Three columns: the advisory id, the type with its severity, and the package version that carries the fix. The same Rocky host, unfiltered with dnf updateinfo list, printed lines like these (trimmed):

RLSA-2022:6159              Moderate/Sec.  curl-7.61.1-22.el8_6.4.x86_64
FEDORA-EPEL-2022-42c9410b12 bugfix         koji-1.30.0-1.el8.noarch
RLSA-2022:5819              Important/Sec. kernel-4.18.0-372.19.1.el8_6.x86_64
RLSA-2022:5819              Important/Sec. kernel-core-4.18.0-372.19.1.el8_6.x86_64
RLSA-2022:6206              Important/Sec. systemd-239-58.el8_6.4.x86_64
RLSA-2022:6206              Important/Sec. systemd-libs-239-58.el8_6.4.x86_64

Adding --security drops the bugfix and enhancement lines and keeps the ones marked /Sec.. The advisory id repeats because RLSA-2022:5819 fixes both kernel and kernel-core, and list is per package. For one line per advisory, keep the first column and deduplicate it:

dnf -q updateinfo list --security | awk '{print $1}' | sort -u

The AlmaLinux wiki writes the same command as dnf updateinfo --list. Both spellings work in dnf 4.

Two flags are useful with list. --installed shows advisories for package versions equal to or older than your installed versions. --with-cve prints CVE ids in place of advisory ids, so you can grep for one.

dnf updateinfo list --security --installed
dnf updateinfo list --security --with-cve

Read one advisory with dnf updateinfo info

Take an id from your list and ask for the full text:

dnf updateinfo info ALSA-2025:2627

The output is one block per advisory, framed by lines of = signs. The title comes first, then labelled fields: Update ID, Type, Updated, Bugs, CVEs, Description, Severity and Installed. The CVEs field lists one id per line. For ALSA-2025:2627, which errata.almalinux.org publishes as "Important: kernel security update" dated 2025-03-14, that field holds six CVEs, among them CVE-2024-50302 and CVE-2024-53197, and the package list is the whole kernel-5.14.0-503.31.1.el9_5 set. On Rocky the same fix ships under the RLSA prefix with the same number: the Rocky CVE hygiene guide states that RLSA advisories mirror the upstream RHSA and share its number, with only the prefix changed.

You can also start from a CVE id and find the advisory that fixes it:

dnf updateinfo info --cve CVE-2024-6119

If that prints nothing, add --installed. The default available view only shows advisories for versions newer than the one you have, so a CVE you already patched is silent until you ask for installed advisories. If it still prints nothing, check whether the CVE affects an installed package, whether the repository carrying the fix is enabled, and whether its metadata includes the advisory. The verification section below helps check for missing advisory metadata.

Preview with dnf check-update --security

dnf check-update --security
echo $?

check-update lists available updates without resolving the upgrade transaction and exits with code 100 when updates are available, 0 when none are available, and 1 on an error. A listed version is not a promise that dnf upgrade will install it; dependency restrictions can prevent installation. With --security it filters the available updates using security advisory metadata. The exit code is the useful part: a cron job or a monitoring check can run dnf -q check-update --security and alert on 100 without parsing any text.

Apply only the security updates

sudo dnf upgrade --security

dnf builds a transaction from every installed package that has a newer version named in a security advisory, then resolves dependencies as it always does. Read the transaction summary before you type y. The filter chooses the targets, and dependency resolution can add packages with no advisory of their own because a target requires them. That is correct behaviour, but it means "security only" describes the reason for the transaction, not every package in it.

upgrade takes each target to the newest version available that dependency resolution permits. If you want the smallest possible change, upgrade-minimal takes each package only to the nearest version that carries the fix:

sudo dnf upgrade-minimal --security

The same flags select the other advisory types. --bugfix, --enhancement and --newpackage each add their type to the filter, and the flags combine, so --security --bugfix installs the union of both.

sudo dnf upgrade --bugfix
sudo dnf upgrade --security --bugfix

If a security update breaks something, the transaction is in dnf history, and dnf history undo can roll it back as one unit.

Target one advisory or one CVE

sudo dnf upgrade --advisory=ALSA-2025:2627
sudo dnf upgrade --cve=CVE-2024-50302
sudo dnf upgrade --sec-severity=Critical,Important

--advisory and --cve select upgrade targets that fix what you named; dependency resolution can also update packages outside those advisories. Both take a comma-separated list, and both can be repeated. --sec-severity accepts Critical, Important, Moderate and Low, and it matches exactly, so Critical alone does not include Important. List every level you want.

Verify afterwards from the metadata, and then from the package itself:

dnf updateinfo list --cve CVE-2024-50302 --installed
rpm -q --changelog kernel-core | grep CVE-2024-50302

The first command should now list the advisory next to the package version recorded in that advisory, which can be older than the installed version. The second reads the RPM changelog, which the packager writes and which does not depend on updateinfo.xml, so it confirms the fix is in the binary you installed. The Rocky documentation warns that binary RPM changelogs can be truncated, so an empty grep is not proof of absence. When you need a full accounting of what is fixed and what is not, checking your server for known CVEs against the OVAL data both distributions publish is the thorough method.

How dnf-automatic uses the same metadata

dnf-automatic is a timer that runs dnf for you. Its configuration file is /etc/dnf/automatic.conf, and one line selects security-only mode:

[commands]
upgrade_type = security
apply_updates = yes

The documented meaning of security is "only those with an issued security advisory". In the source, that setting makes dnf-automatic call add_security_filters with the type security and then upgrade_all. dnf upgrade --security calls the same function with the same argument. There is no second list and no second opinion. The timer selects security targets from the advisory metadata available when it runs, then resolves dependencies; today's dnf updateinfo list --security output is not its final transaction list.

sudo dnf install -y dnf-automatic
sudo systemctl enable --now dnf-automatic-install.timer

The timer unit you enable decides whether updates are only downloaded or also installed. upgrade_type is read from the file in every case. Automatic updates with dnf-automatic on Rocky and AlmaLinux covers the timers and the email and motd reports in detail.

RLSA, ALSA, and what to verify on the day

Both distributions use one prefix per advisory type:

  • RLSA on Rocky and ALSA on AlmaLinux: security
  • RLBA and ALBA: bug fixes
  • RLEA and ALEA: enhancements

Security advisories are ranked Critical, Important, Moderate or Low, the same scale Red Hat uses, and the number after the colon is the Red Hat advisory number the rebuild was made from.

Whether the metadata is complete on a given day is not something to assume. Rocky's errata page says its errata "generally attempts to match the advisories provided by Red Hat", which is a statement of intent rather than a guarantee. On 2025-04-02 the Rocky release engineering forum opened a request for comment on the Apollo errata system, stating that the Red Hat Hydra API it pulled advisories from "is not always 100% accurate" and proposing a move to Red Hat's CSAF VEX data for security advisories. In September 2025 a user reported that the Rocky 9.6 BaseOS updateinfo.xml had not changed since December 2024, and a reply confirmed it as a known issue under investigation. Later in the request for comment thread, in October 2025, a CIQ engineer wrote that the RESF had merged changes allowing regular errata generation, and in December 2025 a user reported that security errata reached their tools promptly after the 9.7 release. The AlmaLinux errata documentation makes no statement about completeness at all.

So verify, with two checks that take a minute each:

dnf check-update
dnf check-update --security

Every package in the first list that the errata site shows under a security advisory should also be in the second list. If a package such as curl appears only in the first list, and errata.rockylinux.org or errata.almalinux.org shows an RLSA or ALSA for that exact version, the metadata and the website disagree. A user reported that exact situation on the Rocky forum in November 2023 for RLSA-2023:5763, and the thread closed with no answer. Upgrade that package by name, sudo dnf upgrade curl, and do not wait for --security to notice.

The second check is the updateinfo timestamp from the repomd.xml command earlier. Compare it with the date of the newest advisory on the errata site for your release. A file that is weeks older than the newest published advisory cannot contain that advisory, so --security cannot install it.

Decide whether the security update needs a reboot

A patched library on disk protects nothing while the old copy is still mapped into a running process. needs-restarting, from the dnf-plugins-core package, compares running processes with the files that were replaced:

sudo dnf needs-restarting -r
echo $?

When the configured reboot-package check finds a listed package installed since boot, the output names the packages under Core libraries or services have been updated since boot-up:, prints Reboot is required to fully utilize these updates., and ends with More information: https://access.redhat.com/solutions/27943. The exit code is 1. Otherwise, it prints No core libraries or services have been updated since boot-up. followed by Reboot should not be necessary., and exits 0. The reboot decision comes from a list of package names installed since boot. In the dnf-plugins-core 4.3.0 source that Rocky 9 and AlmaLinux 9 build from, the list is kernel, kernel-rt, glibc, linux-firmware, systemd, dbus, dbus-broker and dbus-daemon, and the RHEL 9 package adds microcode_ctl. Package names in .conf files under /etc/dnf/plugins/needs-restarting.d/ extend it. A security update to any of those means reboot.

-s lists affected systemd service units. Restart those services, but also run sudo dnf needs-restarting without flags to check affected processes outside service units; a zero reboot hint does not establish that service restarts cover every stale process.

sudo dnf needs-restarting -s

If dnf answers No such command: needs-restarting, install the plugin package with sudo dnf install -y dnf-plugins-core. needs-restarting after updates on Rocky and AlmaLinux goes through the service restart step in detail, including the services the tool says must not be restarted.

Failure modes, with the strings you will see

dnf upgrade --security ends with Nothing to do. while dnf check-update lists updates. Either dnf has no applicable security advisory targets or transaction restrictions prevent their upgrade. Run dnf updateinfo and look at the counts. If it shows bugfix and enhancement notices but no security notices, dnf has no applicable security notices in its current metadata. If it shows no notices at all, check whether applicable advisories exist, whether enabled repositories publish updateinfo (check with the find command above), and whether the metadata is stale (check the timestamp).

A package from a third-party repository never appears under --security. Check whether its repomd.xml has an updateinfo element and whether that metadata names the package in a security advisory. The filter cannot see what nobody published. Upgrade those packages on a normal dnf upgrade schedule instead.

dnf updateinfo info --cve prints nothing for a CVE you read about. Check the installed view with --installed, whether the CVE affects an installed package, whether the fix is available from an enabled repository, and whether its advisory has reached updateinfo.xml. Compare the distribution's errata site with the repository metadata as described above.

The advisory on the website lists a package that dnf updateinfo list does not show. updateinfo only reports advisories for packages you have installed. An advisory for kernel-rt is silent on a server running the standard kernel, and that is correct.

FAQ

What is the difference between dnf updateinfo and dnf check-update?

dnf check-update lists newer versions of installed packages, whatever the reason for the new version. dnf updateinfo reads the advisory metadata and reports why an update exists: security, bugfix, enhancement or new package, with a severity for the security ones. dnf check-update --security is the same package list filtered through that metadata, and it exits with code 100 when a security update is available; it does not resolve the upgrade transaction.

Why does dnf upgrade --security say Nothing to do when updates are available?

Either dnf has no applicable security advisory targets or transaction restrictions prevent their upgrade. The pending updates might be bugfix or enhancement releases, their repository might publish no updateinfo.xml, or the distribution's metadata might be behind its errata website. Run dnf updateinfo to see the counts, then compare dnf check-update against the errata site for your distribution.

How do I install the fix for one CVE on Rocky or AlmaLinux?

sudo dnf upgrade --cve=CVE-2024-50302 selects upgrade targets from the advisory metadata for that CVE, and dependency resolution can also update packages outside that advisory. Then confirm with dnf updateinfo list --cve CVE-2024-50302 --installed, and with rpm -q --changelog <package> | grep CVE-2024-50302. If dnf finds no packages for the CVE, check errata.rockylinux.org or errata.almalinux.org to see whether a fix has been published for your release.

Does dnf-automatic with upgrade_type = security use different data?

No. It calls the same add_security_filters function that dnf upgrade --security uses, with the same security type, and then runs upgrade_all. It selects security targets from the same advisory metadata, then resolves dependencies that can bring in other packages. Verify the metadata the same way for both.

Do I need to reboot after a security update?

Run sudo dnf needs-restarting -r. Exit code 1 with Reboot is required to fully utilize these updates. means the configured reboot-package check found a qualifying package installed since boot. Exit code 0 means that check found none; it does not prove that restarting the services listed by sudo dnf needs-restarting -s covers every stale process. Run sudo dnf needs-restarting without flags to check affected processes outside service units too.

Was this article useful?