What is YUM and how to use it

YUM (Yellowdog Updater, Modified) is the primary package management utility for Red Hat (RHEL), CentOS, and Fedora Linux distributions. It automates the process of installing, updating, removing, and managing software packages along with their dependencies. Below is a complete command cheat sheet and configuration guide.

Understanding YUM and Repositories

YUM is used to install packages directly from the Internet including the ability to update them. The only thing required to use yum is a reliable internet connection to download and install packages as quickly as possible.

The RedHat and Fedora Core-based systems come with the yum utility available. It also contains a list of repositories from where to download the packages. Like RPM and DPKG, yum is used to install, uninstall and update packages from the operating system.

YUM configuration files can be edited to cater to any needs, you can select only certain services or applications for which updates can be made, or you can exclude those updates for specific services or applications. The /etc/yum.repos.d/ directory contains repositories where yum looks for updates or recent versions of applications. Each of these files can be edited to enable or disable specific archives:

  • To enable an archive, set enabled=1 in the file.
  • To disable an archive, set enabled=0.

Once disabled, yum ignores the archive and will not search for it anymore. The archive configuration file stays on your computer, and if you want to exclude that archive altogether, you can simply delete the configuration file.

Essential YUM Command Cheat Sheet

YUM only works when logged in as root and is a handy utility for managing packages in Redhat or Fedora core operating systems (more on OS distributions in our Linux vs FreeBSD article). It is recommended to use it whenever you need a package because you receive the newest version.

Before we start using yum, we recommend updating the list of packages using the command:
yum check-update

And then we can install the packages using the command:
yum install software name

If we want to delete a package that we installed earlier we use the option to remove:
yum remove software name

We can also get information about a package already installed using the syntax info:
yum info software

or we can get a list of valid updates:
yum list updates

We can also update all the packages we have installed using the command:
yum update

To search for a specific package, use the following command:
yum search software

You can get valuable information about a package using the following command:
yum info software

The returned information includes:

  • Name
  • Architecture
  • version
  • Summary
  • URL
  • License
  • Description

Managing Cache & Troubleshooting of YUM

If you have installed specific applications and then accidentally deleted certain apps, some old files may remain in the cache created by yum. To make sure there are no errors in running the yum application, you can delete the cache using the command:
yum clean all

If you prefer a more graphic solution, I recommend you choose YUM Extender. YUM is for RedHat and Fedora what apt-get is for Debian and Ubuntu.

What is YUM? FAQ

What is the difference between YUM and DNF?
DNF (Dandified YUM) is the next-generation version of YUM. It is the default package manager in modern versions of Fedora and RHEL 8+. DNF offers better performance, faster dependency resolution, and less memory usage, but the command syntax remains largely compatible with YUM.
Does YUM handle dependencies automatically?
Yes, this is one of its main advantages over using raw RPM files. When you try to install a package using YUM, it checks the repositories for all required libraries and dependencies, asks for your permission, and installs them alongside the main software.
How do I list all installed packages with YUM?
You can verify what is currently installed on your system by running the command yum list installed. You can also pipe this command to grep to search for specific installed software, for example: yum list installed | grep httpd.
Where does YUM store downloaded packages?
YUM stores downloaded headers and packages in the /var/cache/yum/ directory. Running yum clean all clears this directory to free up disk space and force YUM to re-download fresh metadata from the repositories.

About the author

Ilias spiros
By Ilias spiros

Categories