Introduction
RPM and YUM are package management systems created for Red Hat-
based Linux distributions. A package management system is a collection
of tools used for automating package installation, updating, and removal.
While the two package managers have similarities, they mainly differ in
functionality.
In this article, you will learn about the difference between RPM and
YUM.
Note: If you are using Ubuntu, learn to manage packages with apt-get.
What is RPM
RPM is a command-line package manager developed in 1995 by Red
Hat. The package manager was designed to work on Red Hat-based
systems. Today, RPM is the core component of many Linux distributions,
including CentOS, Fedora, Oracle Linux, openSUSE, Mageia, etc.
The RPM package manager allows users to query, verify, install, upgrade,
and remove packages. The main downside is that it doesn't resolve
package dependencies or automatic package updates.
What is YUM
YUM (Yellow Dog Updater, Modified) is an open-source Linux package
management application that uses the RPM package manager. This front-
end RPM tool allows users to search official and third-party repositories
and install, update, or remove packages from the system.
YUM works with online repositories listed in
the /etc/yum.repos.d/*.repo file. Additionally, the tool allows users to add
their own *.repo files.
YUM's benefits over RPM are automatic updates, easy package
management and dependency management.
Note: Learn to install Pip on CentOS 8. Pip is a standard Python
package manager for installing additional packages that are not part of
Python standard library.
RPM vs. YUM
Both RPM and YUM install packages, keep the information in a
database, and provide basic command-line functionality. However, there
are several differences between the two package managers.
Parameter RPM (Red Hat Package Manager) YUM (Yellow Dog Updater, M
Origin Introduced in 1997 by Red Hat. Upgraded from YUP to YUM in
Parameter RPM (Red Hat Package Manager) YUM (Yellow Dog Updater, M
A low-level package manager with basic A top-level front-end package m
Definition
functionality. with advanced functionality.
Resolves and installs package
Dependencies Does not resolve dependencies.
dependencies automatically.
Doesn't allow multiple package
Allows multiple package versions to be to be installed. Only supports pa
Package installed. available in the repository and s
installation However, only a single package already installed packages.
installation is possible at a time. On the other hand, YUM can in
multiple packages simultaneous
YUM allows automatic upgrade
Upgrades RPM doesn’t support automatic upgrades.
latest available version.
RPM doesn't use an online repository for
YUM relies on an online reposi
Repository package installation. Instead, it requires
installing packages. The utility r
support the exact local .rpm package path to
only the package name.
complete the installation.
YUM is a front-end utility that u
RPM is autonomous and utilizes its own
RPM package manager for pack
Autonomy database to keep information about the
management. The utility also us
packages on the system.
RPM database in the backend.
RPM package management and handling It is the easiest way to manage R
Ease of use
gets complicated at times. packages.
YUM allows any changes to be
Rollback RPM doesn't support change rollback.
back.
The following table shows an overview of the key differences between
RPM and YUM:
Note: Learn how to uninstall or remove packages in CentOS using
RPM or YUM.
Dependencies
The biggest RPM drawback is that it doesn't fetch the required
package dependencies during installation. As it installs packages with
the information within them and without using repositories, RPM cannot
resolve dependencies. Therefore, users must figure out the package
dependencies manually.
Since RPM does not keep information on automatically added packages,
there is no way to find out which dependencies to remove as well when
deleting a package with RPM.
Additionally, there is no prompt before removing packages except when
removing a package required for another program. In that case, RPM
outputs an error message and prevents the removal.
YUM can scan, sense and resolve a package dependency tree
automatically. That means YUM automatically fetches any additional
packages necessary for a program to function properly. YUM resolves
dependencies using a depsolver, a package dependency management
library. With this tool, it fetches the dependencies from online
repositories and installs the necessary packages.
Note: See how to list installed packages using YUM.
Package Installation
YUM is a much better option than RPM when performing a batch
installation. Since YUM utilizes online repositories, it only requires the
package names. YUM installs the packages and the necessary
dependencies automatically.
For example, installing a MySQL server on CentOS 8 with yum only
requires the package name:
The utility installs the MySQL server and resolves all dependencies
automatically.
The downside of YUM is that it does not allow to install multiple
package versions. Also, it only supports packages available in the
repository.
RPM allows to install multiple packages and versions, but it requires the
full file name with the .rpm extension. Still, it does not solve the
dependencies for the installed packages.
For example:
RPM installs the specified package and outputs an error, stating that there
are dependencies which have not been installed.
Upgrades
Package upgrades usually bring more functionality, bug fixes, or
unnecessary feature removal. RPM cannot handle package upgrades
automatically and requires individual upgrades for each package. The
RPM upgrade process involves downloading the RPM files, which is
similar to installing new packages.
On the other hand, YUM scans the installed packages and notifies the
user if upgrades are available. YUM upgrades packages automatically
using online repositories.
Repository Support
Since RPM doesn't support repositories, installing a package requires
the full package file name and location. RPM keeps an internal database
of the installed packages and allows you to later manage the installed
packages using the package name.
On the other hand, installing a package with YUM only requires the
package name, and doesn't require the package location. The tool
searches the repositories listed in the repo files from
the /etc/yum.repos.d/ directory and installs the latest package version
available.
Note: Follow our tutorial to create a local YUM repository on CentOS
7.
Autonomy
RPM is a standalone package manager that holds all the information
required for a proper package installation or removal: the file lists, the
permissions, the scripts, etc. The data is contained within an RPM python
library.
On the other hand, YUM uses the RPM python library for most of its
local operations and cannot function without it. That means YUM isn't
a standalone package manager, but it provides additional functionalities
on top of RPM.
Conclusion
After reading this comparison article, you now better understand the
similarities and differences between RPM and YUM. Both are package
managers for Red Hat Linux distributions, but their functionalities are
different.
RPM is powerful when you have the required .rpm packages and the
dependencies manually figured out or if you need to query the package
information database. Otherwise, it is better to use YUM in day-to-day
usage because it keeps the system updated and clean.