yum Command: Usage and Options, yum-utils, and Checking Repositories
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/dnflrwxrwxrwx 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-3Both files were links that point to dnf-3. That is why running yum --version shows the dnf version.
yum --version4.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 2026The 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 12usage: 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 packageThe commonly used commands are collected in the table.
| Command | Task | |
|---|---|---|
| list installed | List of installed packages (add a package name to show only that package) | |
| list updates | List of packages with a newer version in the repository | |
| check-update | Check whether updates are available (exit code 100 if there are) | |
| info | Version, size, repository, and description of one package | |
| search | Search packages by name and summary | |
| install | Install a package (including dependencies) | |
| remove | Remove a package (same as erase) | |
| update | Update installed packages to a newer version (same as upgrade) | |
| autoremove | Remove packages that were installed as dependencies and are no longer needed | |
| makecache | Download repository metadata in advance and build the cache | |
| clean all | Delete the whole downloaded cache | |
| repolist | List of enabled repositories | |
| deplist | Dependencies and providing packages (repoquery --deplist is recommended) | |
| history | History 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.
| Option | Copy | Description |
|---|---|---|
| -C, --cacheonly | Uses only the downloaded cache without connecting to the repositories. | |
| -q, --quiet | Hides notices such as the metadata line and prints only the result. | |
| --showduplicates | Prints both the installed version and the repository versions of the same package. | |
| --exclude=PKG, -x PKG | Excludes that package from this command (patterns such as kernel* work). | |
| --enablerepo=REPO | Enables a disabled repository for this command only. | |
| --version | Prints the yum (dnf) and rpm versions. | |
| -h, --help | Prints the help. |
| Option | Copy | Description |
|---|---|---|
| -y, --assumeyes | Answers yes to every question. | |
| -v, --verbose | Prints the details of the operation. | |
| --disablerepo=REPO | Disables an enabled repository for this command only. | |
| --skip-broken | Skips 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 treeLast 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 @baseosWith -q, the first line disappears and only the result is shown.
yum -C -q list installed treeInstalled 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 libavifLast 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 epel0.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 libdav1dLast metadata expiration check: 0:35:10 ago on Thu Oct 29 05:32:35 2026.
libdav1d.x86_64 1.5.4-2.el9 epelTwo 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 treeInstalled 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 libaviftree-1.8.0-12.el9.x86_64
package htop is not installed
libavif-0.11.1-7.el9.x86_64For 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 libdav1dLast 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 epelThe 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
100The 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 makecachemakecache downloads the repository metadata in advance. update downloads it on its own, so you can skip this step.
yum updateupdate upgrades all installed packages to their new versions and handles dependencies as well.
yum update libavifAdd a package name to upgrade only that package.
yum autoremoveautoremove 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-utilsLast 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/yumdownloaderls -l /usr/bin/yumdownloader /usr/bin/repoquery /usr/bin/needs-restarting /usr/bin/yum-config-managerlrwxrwxrwx 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-utilsAll 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.
yumdownloader only downloads package files without installing them. With --urls, it prints only the addresses it would download from.
yumdownloader --urls treeLast 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.rpmThe 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 treeLast 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 treeLast 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 treeLast 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_64The 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 -rNo 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-cleanuppackage-cleanup has to be executed with one of the options: --dupes, --leaves, --orphans, --problems or --cleandupes5️⃣ 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 repolistrepo 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 - Extrasrepolist 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 12repo 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 repolistrepo 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 - Extrascrb 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.
Adding a new repository such as EPEL comes down to installing a single repository package.
yum install epel-releaseOnce 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.
🔢 FAQ & Recommended Content
Linux · Concepts
What is a Linux package
Explains what the packages yum handles are and why dependencies arise, compared with Windows installer files.
Ubuntu · Packages
Ubuntu apt command
The apt command that takes yum's place on Debian-based systems, the difference from apt-get, and how to install and update.
Linux · Packages
Installing snapd on Linux
How to install programs that are not in the distribution's repositories with snap, tested on Rocky Linux.
ℹ️ 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.