yum Command: Usage and Options, yum-utils, and Checking Repositories

Test environmentRHEL familyAlmaLinux 9.8root account
Package commandsyumyum-utilsrpmLocation/usr/bin/yum

The yum command is the package management command that installs, updates, and removes packages on RHEL-based Linux. When we ran the query and update-check commands and the yum-utils tools on an AlmaLinux 9 server, yum ran as the same program as dnf, and the output was the same as dnf.

The repository list, package release numbers, and install times in the output below are example values.

1️⃣ yum Command Basics: yum and dnf

On AlmaLinux 9, typing yum runs dnf. This is because /usr/bin/yum is a link that points to dnf-3.

ls -l /usr/bin/yum /usr/bin/dnf
lrwxrwxrwx 1 root root 5 Oct  5 10:12 /usr/bin/dnf -> dnf-3
lrwxrwxrwx 1 root root 5 Oct  5 10:12 /usr/bin/yum -> dnf-3

Both files were links that point to dnf-3. That is why running yum --version shows the dnf version.

yum --version
4.14.0
  Installed: dnf-0:4.14.0-21.el9_8.alma.1.noarch at Mon Oct  5 10:12:30 2026
  Built    : AlmaLinux Packaging Team <packager@almalinux.org> at Fri May  1 09:30:00 2026

  Installed: rpm-0:4.16.1.3-23.el9.x86_64 at Mon Oct  5 10:12:08 2026
  Built    : AlmaLinux Packaging Team <packager@almalinux.org> at Thu Mar 12 08:15:20 2026

The first line, 4.14.0, is the dnf version, followed by the times the dnf and rpm packages were installed. The rpm version appears as well because yum ultimately installs the packages it gets from the repository with rpm.

The basic form of the command is yum, options, command, and package name, in that order. The first line of --help shows this form, followed by the list of commands.

yum --help | head -n 12
usage: yum [options] COMMAND

List of Main Commands:

alias                     List or create command aliases
autoremove                remove all unneeded packages that were originally installed as dependencies
check                     check for problems in the packagedb
check-update              check for available package upgrades
clean                     remove cached data
deplist                   [deprecated, use repoquery --deplist] List package's dependencies and what packages provide them
distro-sync               synchronize installed packages to the latest available versions
downgrade                 Downgrade a package

The commonly used commands are collected in the table.

CommandTask
list installedList of installed packages (add a package name to show only that package)
list updatesList of packages with a newer version in the repository
check-updateCheck whether updates are available (exit code 100 if there are)
infoVersion, size, repository, and description of one package
searchSearch packages by name and summary
installInstall a package (including dependencies)
removeRemove a package (same as erase)
updateUpdate installed packages to a newer version (same as upgrade)
autoremoveRemove packages that were installed as dependencies and are no longer needed
makecacheDownload repository metadata in advance and build the cache
clean allDelete the whole downloaded cache
repolistList of enabled repositories
deplistDependencies and providing packages (repoquery --deplist is recommended)
historyHistory of install and remove transactions

2️⃣ yum Command Options: -y, -C, exclude, enablerepo

Options go between yum and the command. -y answers yes to the questions, so it belongs in scripts; when you run update by hand on a production server, it is better to leave out -y, read the transaction table, and answer yourself.

OptionCopyDescription
-C, --cacheonlyUses only the downloaded cache without connecting to the repositories.
-q, --quietHides notices such as the metadata line and prints only the result.
--showduplicatesPrints both the installed version and the repository versions of the same package.
--exclude=PKG, -x PKGExcludes that package from this command (patterns such as kernel* work).
--enablerepo=REPOEnables a disabled repository for this command only.
--versionPrints the yum (dnf) and rpm versions.
-h, --helpPrints the help.
OptionCopyDescription
-y, --assumeyesAnswers yes to every question.
-v, --verbosePrints the details of the operation.
--disablerepo=REPODisables an enabled repository for this command only.
--skip-brokenSkips packages with broken dependencies and continues with the rest.

-C prints the result using only the downloaded cache, without connecting to the repositories. The first line shows when the cache was last refreshed, and the result starts on the second line.

yum -C list tree
Last metadata expiration check: 0:35:03 ago on Thu Oct 29 05:32:35 2026.
Installed Packages
tree.x86_64                         1.8.0-12.el9                         @baseos

With -q, the first line disappears and only the result is shown.

yum -C -q list installed tree
Installed Packages
tree.x86_64                         1.8.0-12.el9                         @baseos

--showduplicates prints the installed version and the versions in the repository side by side.

yum -C --showduplicates list libavif
Last metadata expiration check: 0:38:15 ago on Thu Oct 29 05:32:35 2026.
Installed Packages
libavif.x86_64                      0.11.1-7.el9                       @epel
Available Packages
libavif.x86_64                      1.1.1-2.el9                        epel

0.11.1 under Installed Packages and 1.1.1 under Available Packages are two versions of the same package. The repository version is higher, so libavif is due for an update.

--exclude removes that package from this command.

yum -C --exclude=libavif check-update libavif libdav1d
Last metadata expiration check: 0:35:10 ago on Thu Oct 29 05:32:35 2026.

libdav1d.x86_64                         1.5.4-2.el9                         epel

Two packages were given, but libavif was excluded and only libdav1d remained. Added to update, it updates everything except that package.

3️⃣ yum Package Management and Update Order

Even if you know the options, you need to see what is installed and what is new before you can decide which packages to update. So we start with the commands that check installed packages.

yum -C list installed tree
Installed Packages
tree.x86_64                         1.8.0-12.el9                         @baseos

@baseos in the last column is the repository the package was installed from. Querying with rpm -q shows the version on a single line.

rpm -q tree htop libavif
tree-1.8.0-12.el9.x86_64
package htop is not installed
libavif-0.11.1-7.el9.x86_64

For a package that is not installed, the output ends with a single "not installed" line, and the exit code is 1.

Packages with a new version in the repository are checked with list updates.

yum -C list updates libavif libdav1d
Last metadata expiration check: 0:35:07 ago on Thu Oct 29 05:32:35 2026.
Available Upgrades
libavif.x86_64                          1.1.1-2.el9                         epel
libdav1d.x86_64                         1.5.4-2.el9                         epel

The packages under Available Upgrades are the ones with a new version. Without a package name, it checks everything that is installed.

check-update also reports the same list through its exit code.

yum -C check-update libavif libdav1d; echo $?
Last metadata expiration check: 0:35:08 ago on Thu Oct 29 05:32:35 2026.

libavif.x86_64                          1.1.1-2.el9                         epel
libdav1d.x86_64                         1.5.4-2.el9                         epel
100

The 100 on the last line is the exit code. It is 100 when updates are available and 0 when there are none, so scripts decide based on this value.

Updates go in the order makecache, update, autoremove.

yum makecache

makecache downloads the repository metadata in advance. update downloads it on its own, so you can skip this step.

yum update

update upgrades all installed packages to their new versions and handles dependencies as well.

yum update libavif

Add a package name to upgrade only that package.

yum autoremove

autoremove removes packages that were installed together as dependencies and are no longer needed. Run it after update.

yum update --exclude='kernel*'

To update without the kernel, add a kernel pattern to --exclude. After a kernel update, the server has to reboot to run on the new kernel, and you can check whether a reboot is needed with needs-restarting from yum-utils.

4️⃣ yum-utils Tools: yumdownloader, repoquery, needs-restarting

On AlmaLinux 9, yum-utils is a compatibility layer provided by dnf-plugins-core. The command names are the same as in the old YUM days, but what actually runs are dnf plugins.

yum -C info yum-utils
Last metadata expiration check: 0:38:12 ago on Thu Oct 29 05:32:35 2026.
Installed Packages
Name         : yum-utils
Version      : 4.3.0
Release      : 14.el9
Architecture : noarch
Size         : 23 k
Source       : dnf-plugins-core-4.3.0-14.el9.src.rpm
Repository   : @System
From repo    : baseos
Summary      : Yum-utils CLI compatibility layer
URL          : https://github.com/rpm-software-management/dnf-plugins-core
License      : GPLv2+
Description  : As a Yum-utils CLI compatibility layer, supplies in CLI shims for
             : debuginfo-install, repograph, package-cleanup, repoclosure, repomanage,
             : repoquery, reposync, repotrack, repodiff, builddep, config-manager, debug,
             : download and yum-groups-manager that use new implementations using DNF.

The Source is dnf-plugins-core and the Summary is Yum-utils CLI compatibility layer. If it is not installed, install it with [yum install yum-utils].

The 17 commands this package installs are listed with rpm -ql.

rpm -ql yum-utils | grep bin/
/usr/bin/debuginfo-install
/usr/bin/find-repos-of-install
/usr/bin/needs-restarting
/usr/bin/package-cleanup
/usr/bin/repo-graph
/usr/bin/repoclosure
/usr/bin/repodiff
/usr/bin/repomanage
/usr/bin/repoquery
/usr/bin/reposync
/usr/bin/repotrack
/usr/bin/yum-builddep
/usr/bin/yum-config-manager
/usr/bin/yum-debug-dump
/usr/bin/yum-debug-restore
/usr/bin/yum-groups-manager
/usr/bin/yumdownloader
ls -l /usr/bin/yumdownloader /usr/bin/repoquery /usr/bin/needs-restarting /usr/bin/yum-config-manager
lrwxrwxrwx 1 root root 22 Mar  3  2026 /usr/bin/needs-restarting -> /usr/libexec/dnf-utils
lrwxrwxrwx 1 root root 22 Mar  3  2026 /usr/bin/repoquery -> /usr/libexec/dnf-utils
lrwxrwxrwx 1 root root 22 Mar  3  2026 /usr/bin/yum-config-manager -> /usr/libexec/dnf-utils
lrwxrwxrwx 1 root root 22 Mar  3  2026 /usr/bin/yumdownloader -> /usr/libexec/dnf-utils

All of them were links pointing to the single file /usr/libexec/dnf-utils. The commonly used tools and what they do are grouped in a tree.

yum-utilsOne package — all 17 commands are links to /usr/libexec/dnf-utils
yumdownloaderDownload package files (.rpm) · --urls prints only the addresses
repoqueryQuery a package's file list, dependencies, and reverse dependencies
needs-restartingCheck whether a reboot or restart is needed after an update
package-cleanupFind duplicate, orphaned, and problem packages
yum-builddepInstall the packages needed to build a source RPM
yum-config-managerEnable, disable, and add repositories (changes the configuration files)
repoclosure · repodiff · repomanage · repo-graphCheck, compare, clean up, and graph repositories
reposync · repotrackDownload repositories and groups of packages
debuginfo-install · find-repos-of-install · yum-debug-dump · yum-debug-restore · yum-groups-managerDebug info · source repository · config dump and restore · group management

yumdownloader only downloads package files without installing them. With --urls, it prints only the addresses it would download from.

yumdownloader --urls tree
Last metadata expiration check: 0:35:16 ago on Thu Oct 29 05:32:35 2026.
https://repo.almalinux.org/almalinux/9.8/BaseOS/x86_64/os/Packages/tree-1.8.0-12.el9.x86_64.rpm

The repository address and the file name appear on one line. You can use this address to download in advance the files you will move to and install on a server without internet access.

repoquery looks up the files a package installs and its dependencies.

repoquery -l tree
Last metadata expiration check: 0:35:17 ago on Thu Oct 29 05:32:35 2026.
/usr/bin/tree
/usr/lib/.build-id
/usr/lib/.build-id/e0
/usr/lib/.build-id/e0/e2ec3d46003583b56979e08d437395bd0d2a07
/usr/share/doc/tree
/usr/share/doc/tree/README
/usr/share/licenses/tree
/usr/share/licenses/tree/LICENSE
/usr/share/man/man1/tree.1.gz

-l is the file list of that package. It contains one executable, plus the documentation, license, and manual.

repoquery --requires tree
Last metadata expiration check: 0:35:19 ago on Thu Oct 29 05:32:35 2026.
libc.so.6(GLIBC_2.34)(64bit)
rtld(GNU_HASH)

--requires shows the libraries it needs. yum deplist prints the same information plus the providing packages, but its help marks it as deprecated, so repoquery --deplist is used instead.

yum -C repoquery --deplist tree
Last metadata expiration check: 0:38:17 ago on Thu Oct 29 05:32:35 2026.
package: tree-1.8.0-12.el9.x86_64
  dependency: libc.so.6(GLIBC_2.34)(64bit)
   provider: glibc-2.34-170.el9_8.x86_64
  dependency: rtld(GNU_HASH)
   provider: glibc-2.34-170.el9_8.i686
   provider: glibc-2.34-170.el9_8.x86_64

The dependency lines are what is needed, and the provider lines are the packages that provide them.

Whether a reboot is needed after an update is checked with needs-restarting -r.

needs-restarting -r
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.

After the kernel or a core library has been updated, the message changes to say a reboot is needed, and it ends with exit code 1.

Run without options, package-cleanup only prints a prompt asking which check to run.

package-cleanup
package-cleanup has to be executed with one of the options: --dupes, --leaves, --orphans, --problems or --cleandupes

5️⃣ Checking yum Repositories: repolist and the enablerepo Option

Even with the tools in place, yum finds nothing if the package is not in a repository. So first check which yum repositories are enabled.

yum repolist
repo id             repo name
appstream           AlmaLinux 9 - AppStream
baseos              AlmaLinux 9 - BaseOS
epel                Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras              AlmaLinux 9 - Extras

repolist prints only the repositories with enabled=1 in their configuration files. baseos and appstream are the distribution's default repositories, and epel is a repository added separately.

yum repolist --all | head -n 12
repo id                       repo name                                 status
appstream                     AlmaLinux 9 - AppStream                   enabled
appstream-debuginfo           AlmaLinux 9 - AppStream - Debug           disabled
appstream-source              AlmaLinux 9 - AppStream - Source          disabled
baseos                        AlmaLinux 9 - BaseOS                      enabled
baseos-debuginfo              AlmaLinux 9 - BaseOS - Debug              disabled
baseos-source                 AlmaLinux 9 - BaseOS - Source             disabled
crb                           AlmaLinux 9 - CRB                         disabled
crb-debuginfo                 AlmaLinux 9 - CRB - Debug                 disabled
crb-source                    AlmaLinux 9 - CRB - Source                disabled
epel                          Extra Packages for Enterprise Linux 9 - x enabled
epel-cisco-openh264           Extra Packages for Enterprise Linux 9 ope enabled

--all prints the disabled repositories too, together with a status column. Packages in a disabled repository such as crb cannot be installed as is.

To enable a disabled repository for this command only, add --enablerepo.

yum --enablerepo=crb repolist
repo id             repo name
appstream           AlmaLinux 9 - AppStream
baseos              AlmaLinux 9 - BaseOS
crb                 AlmaLinux 9 - CRB
epel                Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras              AlmaLinux 9 - Extras

crb now appears in the list. The configuration file stays the same, so it drops out again in the next command. To keep a repository enabled, use yum-config-manager to change the configuration file. You can see repositories being enabled and disabled by pressing the command buttons in the diagram below.

🧭 Repositories where yum looks for packages
Explainer diagram
🔍 Command
$ yum repolist--enablerepo=crb repolist--disablerepo=epel repolist
baseosOnOn onceOff once
appstreamOnOn onceOff once
extrasOnOn onceOff once
epelOnOn onceOff once
crbOffOn onceOff once
➜
yumRepositories searched for packages564
repolist prints only the repositories with enabled=1 in their configuration files. yum looks for packages only in the repositories on this list. Packages in a disabled repository such as crb are not visible.
Adding --enablerepo=crb enables crb for this one command only, so it enters the list. The configuration file does not change, so it drops out again in the next command.
Adding --disablerepo=epel removes epel for this one command only. To keep a repository enabled or disabled, use yum-config-manager, which changes the configuration file.

Adding a new repository such as EPEL comes down to installing a single repository package.

yum install epel-release

Once installed, an epel.repo file is created under /etc/yum.repos.d/, and epel appears in repolist.

🔲 yum Command Simulator

In the simulator below, you can type yum list, check-update, repolist, and yum-utils commands yourself and check the output. The repository list uses the same example values as the article, and the install, remove, and update commands only show a notice.

yum Command Simulatoryum 4.14.0
[root@server work]#
Use the ↑↓ keys to recall commands you typed earlier.

🔢 FAQ & Recommended Content

No. Typing yum delete ends with the error No such command: delete. To remove a package, use yum remove; erase does the same thing.

They are the same command. In dnf, update is another name for upgrade, so even yum help update shows help that starts with usage: yum upgrade.

With -C, list and info run from the downloaded cache without connecting to the repositories. To install a package, download the .rpm file with yumdownloader on another server, move it over, and pass the file path to install.

ℹ️ Affiliate Disclosure
This site's content contains affiliate links. When a visitor buys a product or service through one of them, the site receives a commission from the seller. The amount the buyer pays(it goes down during event discounts ↓)does not go up. Posted prices, discounts, and stock reflect the time of writing and may differ, so confirm with the seller before buying. Products are chosen and reviewed by our own standards, and commissions do not affect the order or content of reviews.

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove your humanity: 9   +   4   =