Distribution repositories deliver security and bug fixes between operating system releases. On Fedora Workstation and Server, Red Hat Enterprise Linux (RHEL), and CentOS Stream, DNF applies those fixes by updating installed RPM packages.

DNF draws package updates from enabled repositories and stays within the installed major release. On an unpinned RHEL-family system, an update can advance the minor release. Moving to a new major release requires a separate operating system upgrade. Package exclusions or dependency conflicts can keep individual packages on older versions.

Package updates change the files on disk. A new kernel takes effect after a reboot, and running services may need a restart to load updated libraries.

Steps to update packages with DNF:

  1. Open the upgrade transaction with refreshed repository metadata.

    Package updates can interrupt services. On a critical host, have a current backup or snapshot and a maintenance window before starting. Setting assumeyes to False for this run prevents automatic confirmation.

    $ sudo dnf upgrade \
      --refresh \
      --setopt=assumeyes=False
  2. Respond to the DNF prompt based on the package changes and repositories shown.

    Enter y if the changes are expected or n if anything is unexpected, such as removal of required software or a package from an unfamiliar repository. If DNF reports nothing to do, continue to the final check.

    Is this ok [y/N]: y
    ##### snipped #####
    Complete!
  3. Verify that a fresh repository check lists no pending updates.
    $ sudo dnf check-upgrade \
      --refresh; echo $?
    ##### snipped #####
    Repositories loaded.
    0

    On DNF 4, use check-update in place of check-upgrade. A package list and status 100 mean updates are still available. A metadata download error or an Ignoring repositories message makes the check incomplete, even if the status is 0.

Share this guide