Updated: 9 October 2026 · Applies to: yum 4.20 (AlmaLinux 10), yum 4.14 (Rocky Linux 9 and RHEL 9 UBI), yum-utils 4.7 (dnf-plugins-core), Fedora 44 (dnf5); Debian 13 and Ubuntu 24.04 and 26.04 have no yum

On AlmaLinux, Rocky Linux, RHEL 9 and 10 and Fedora you do not need to install yum: it is already there as a link to dnf. Install software with sudo yum install PACKAGE (or sudo dnf install PACKAGE, which is the same program). Some minimal container images, such as Red Hat UBI minimal, lack it; there, microdnf install yum adds it. Debian and Ubuntu do not use yum at all: install packages with sudo apt install PACKAGE.

sudo yum install nginx

1. Check whether yum is installed

$ ls -l /usr/bin/yum
lrwxrwxrwx 1 root root 5 May 19 00:00 /usr/bin/yum -> dnf-3
$ rpm -qf /usr/bin/yum
yum-4.20.0-22.el10_2.alma.1.noarch

That is AlmaLinux 10. On Rocky Linux 9 the same link belongs to yum-4.14.0, and on Fedora 44 /usr/bin/yum points to dnf5. Every yum command you find in older guides runs dnf, so the options and output are dnf's.

2. Install yum if it is missing

  • Minimal images (for example Red Hat's UBI 9 minimal container) only have microdnf: yum and dnf both give "command not found". Install it with:
    $ microdnf install -y yum
    ...
    Installing: python3-dnf;4.14.0-34.el9_8;noarch;ubi-9-baseos-rpms
    Installing: dnf;4.14.0-34.el9_8;noarch;ubi-9-baseos-rpms
    Installing: yum;4.14.0-34.el9_8;noarch;ubi-9-baseos-rpms
    Complete.
    (output shortened). Afterwards /usr/bin/yum points to dnf-3.
  • dnf works but yum does not: the link comes from the small yum package, so run sudo dnf install yum.
  • CentOS Linux 7 or 8: both are end of life and their packages were moved to the CentOS vault, so they get no updates. Move the server to AlmaLinux or Rocky Linux instead of repairing yum there.

3. How to use sudo yum install

yum install changes the system, so it needs root. As a normal user it refuses:

Error: This command has to be run with superuser privileges (under the root user on most systems).

Put sudo in front, or leave it out when you are already logged in as root. If sudo answers USERNAME is not in the sudoers file., add the user to the wheel group as root (usermod -aG wheel USERNAME), then log out and back in. We tested both messages with sudo 1.9.17 on AlmaLinux 10.

Common commands:

sudo yum install nginx                 # install, asks to confirm
sudo yum install -y nginx php-fpm      # several packages, no question
sudo yum install ./package.rpm         # a downloaded RPM file, with its dependencies
yum search nginx                       # find a package by name or summary
yum info tree                          # version, repository, description
yum provides /usr/bin/tree             # which package contains a file
sudo yum remove tree                   # uninstall
sudo yum update                        # update everything

Real output of sudo yum install -y tree on AlmaLinux 10 (shortened):

 tree           x86_64           2.1.0-8.el10            baseos            56 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 56 k
Installed size: 108 k
...
Installed:
  tree-2.1.0-8.el10.x86_64

Complete!

And yum provides /usr/bin/tree answered tree-2.1.0-8.el10.x86_64 : File system tree viewer. More: install, downgrade or lock a specific version, undo a yum install and update all packages safely.

4. Debian and Ubuntu: use apt, not yum

There is no yum package for Debian or Ubuntu. On Debian 13, apt install yum fails with E: Unable to locate package yum; on Ubuntu 24.04 and 26.04 with E: Package 'yum' has no installation candidate. Both offer a dnf package, but according to Debian it "is meant to be used in chroots" of RPM-based systems; it does not install Debian software. Use the apt equivalents:

  • yum install nginx: sudo apt install nginx
  • yum remove nginx: sudo apt remove nginx
  • yum update: sudo apt update && sudo apt upgrade
  • yum search nginx: apt search nginx
  • yum info nginx: apt show nginx

To see which installed package owns a file on either family, see find where a package installed its files.

5. Install yum-utils

yum-utils is a set of helper commands from the CentOS 7 days. On AlmaLinux, Rocky Linux and RHEL 9 and 10 the package still exists and installs dnf-plugins-core with it; the old command names are now small wrappers around dnf plugins, so both names work:

sudo yum install yum-utils

On AlmaLinux 10 it provided yum-config-manager, yumdownloader, repoquery, needs-restarting, package-cleanup, reposync, debuginfo-install, yum-builddep and a few repository tools. The ones you will use most:

  • needs-restarting -r (dnf needs-restarting -r): after updates, tells you whether to reboot. Exit code 1 means yes; on a fresh system it printed "Reboot should not be necessary." -s lists services still running old libraries.
  • yum-config-manager (dnf config-manager): add, enable and disable repositories, for example --add-repo URL or --set-enabled crb.
  • yumdownloader (dnf download): download an RPM without installing it; see download RPM packages with dependencies.
  • repoquery (dnf repoquery): query packages and dependencies; see how to use dnf repoquery.
  • package-cleanup: takes --problems, --orphans, --leaves, --dupes or --cleandupes. The old --oldkernels is gone: sudo dnf remove --oldinstallonly removes kernels over the installonly_limit (3 by default).

The old yum-plugin-versionlock is now python3-dnf-plugin-versionlock (sudo dnf versionlock add nginx); see lock or exclude package updates. Faster downloads are built in: dnf fetches 3 packages in parallel by default, and you can raise max_parallel_downloads in the [main] section of /etc/dnf/dnf.conf.

Official documentation: DNF command reference and DNF plugins core.

Ucartz services for this topic

Was this answer helpful? 1 Users Found This Useful (1 Votes)