Skip to content

DNF Package Management Basics

Applies to CentOS Stream 9 & 10 / AlmaLinux 9.x & 10.x / Rocky Linux 9.x & 10.x

DNF (Dandified YUM) is the default package manager for the EL 9 series, replacing YUM from the EL 7 era. This article will help you master the most common DNF operations for everyday use.

  • Search, install, update, and remove packages
  • View installed packages and package information
  • Manage the package cache
  • Understand the relationship between DNF and YUM
  • A system with EL 9.x installed (physical or virtual machine)
  • A user account with sudo privileges
  • The system is connected to the internet

Use dnf search to find packages in the repositories:

Search for packages containing nginx
$ dnf search nginx

Example output:

Last metadata expiration check: 2:15:30 ago on Mon 24 Mar 2026.
======================== Name Exactly Matched: nginx ========================
nginx.x86_64 : A high performance web server and reverse proxy server
==================== Name & Summary Matched: nginx ====================
nginx-mod-http-perl.x86_64 : Nginx HTTP perl module
nginx-mod-stream.x86_64 : Nginx stream modules
  1. View package information (optional but recommended)

    View detailed information about the nginx package
    $ dnf info nginx
  2. Install the package

    Install nginx
    $ sudo dnf install nginx

    DNF will display the list of packages and dependencies to be installed. Type y to confirm.

  3. Verify the installation

    Confirm nginx is installed
    $ rpm -q nginx
    nginx-1.24.0-1.el9.x86_64
Update a single package
$ sudo dnf update nginx
Update all installed packages
$ sudo dnf update
Only check for available updates without installing
$ dnf check-update
Remove nginx
$ sudo dnf remove nginx
List all installed packages
$ dnf list installed
List installed packages (filter by keyword)
$ dnf list installed | grep nginx
Find which package owns a specific file
$ dnf provides /usr/sbin/nginx
Clear all caches
$ sudo dnf clean all
Rebuild the metadata cache
$ sudo dnf makecache

On EL 9, the yum command is actually a symlink to dnf:

Verify that yum points to dnf
$ ls -la /usr/bin/yum
lrwxrwxrwx 1 root root 5 Jan 1 00:00 /usr/bin/yum -> dnf-3

You can continue using the yum command — it behaves identically to dnf. However, new users are encouraged to use dnf directly.

The package may not be in any enabled repository. Try:

Terminal window
$ dnf search xxx # Verify the package name is correct
$ dnf repolist # View enabled repositories

If the package is in EPEL, refer to EPEL and Third-Party Repositories.

”This command has to be run with superuser privileges”

Section titled “”This command has to be run with superuser privileges””

You need to use sudo or switch to the root user. See sudo Configuration.

EL 10 still uses DNF 4 (currently 4.20), not DNF 5; day-to-day dnf commands remain compatible with EL 9. The main changes are:

ChangeEL 9EL 10
Package managerDNF 4DNF 4.20 (command-compatible)
AppStream modularityModule streams availableDeprecated: no modular content is distributed; dnf module prints a deprecation warning
filelists metadataDownloaded by defaultNot downloaded by default (saves disk space and time)
DNF debug pluginAvailableRemoved from dnf-plugins-core
versionlockdnf-plugin-versionlockSame; still uses versionlock.list
Check current DNF version
dnf --version