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.
The following table shows an overview of the key differences between RPM and YUM:
Parameter | RPM (Red Hat Package Manager) | YUM (Yellow Dog Updater, Modified) |
---|---|---|
Origin | Introduced in 1997 by Red Hat. | Upgraded from YUP to YUM in 2003. |
Definition | A low-level package manager with basic functionality. | A top-level front-end package manager with advanced functionality. |
Dependencies | Does not resolve dependencies. | Resolves and installs package dependencies automatically. |
Package installation | Allows multiple package versions to be installed. However, only a single package installation is possible at a time. | Doesn't allow multiple package versions to be installed. Only supports packages available in the repository and shows the already installed packages. On the other hand, YUM can install multiple packages simultaneously. |
Upgrades | RPM doesn’t support automatic upgrades. | YUM allows automatic upgrades to the latest available version. |
Repository support | RPM doesn't use an online repository for package installation. Instead, it requires the exact local .rpm package path to complete the installation. | YUM relies on an online repository for installing packages. The utility requires only the package name. |
Autonomy | RPM is autonomous and utilizes its own database to keep information about the packages on the system. | YUM is a front-end utility that uses the RPM package manager for package management. The utility also uses the RPM database in the backend. |
Ease of use | RPM package management and handling gets complicated at times. | It is the easiest way to manage RPM packages. |
Rollback | RPM doesn't support change rollback. | YUM allows any changes to be rolled back. |
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.
Note: Check out our comparison of YUM and APT, two popular package management systems.
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.