In this article, discover the intriguing history of the YUM package manager, from its rise to its decline, leading to its eventual replacement by DNF, a modern solution for package management.
Explore whether it still holds value today and gain insights into essential YUM commands for your understanding.
What is YUM in Red Hat or CentOS?
YUM (a.k.a. Yellowdog Updater, Modified) used to be a popular package management tool for RPM-based Linux distributions to install, update, remove, and manage packages.
Initially introduced in the Yellow Dog Linux distribution (in 2003), which gained popularity among PowerPC architecture systems before its discontinuation. Remarkably, the very team behind this distribution was involved in the development of YUM.
After its successful implementation and usage in Yellow Dog Linux, YUM garnered immense popularity for its efficiency in managing package tasks, leading to its widespread adoption by other RPM-based Linux distributions, including:
- CentOS
- Fedora
- Rocky Linux
- AlmaLinux
- Oracle Linux
- Red Hat Enterprise Linux (RHEL)
With YUM in this system, users can easily install and update packages without having to manually download or compile them. Even YUM automatically downloads the required dependencies for the package (quite normal for today’s package managers).
YUM Features at the Time of Release (in 2003)
It was introduced with several features that were considered significant advancements in package management for RPM-based Linux distributions at the time.
The following are some of the notable features at the time of its release:
- Simple Command-Line Interface
- Automatic Dependency Resolution
- Transaction Support
- Repository Configuration
- Repository Management
- Multiple Repositories Support
- Plugin Architecture
- Fast Caching Mechanism
This might be normal today, but at the time, these features made YUM a robust package management tool, simplifying the process of installing, updating, and removing packages on RPM-based Linux distributions like CentOS, Fedora, and Red Hat Enterprise Linux.
Over time, these features have seamlessly evolved and been carried forward to its enhanced successor, DNF (Dandified YUM).
Why DNF Was Introduced
YUM was quite popular, but over time it started facing problems with modern systems. Like getting slower, consuming a lot of memory, and rewriting the code, which requires a lot of effort.
Therefore, moving forward with it served no purpose, and DNF (Dandified YUM) was introduced as a successor to YUM. DNF effectively addresses all the limitations and shortcomings while bringing improvements and new features.
The following are some features or factors that drove the development of DNF:
- Performance and Speed: YUM architectural limitations often resulted in slower package management processes, particularly when handling large repositories or complex dependencies. In contrast, DNF was purposefully designed to prioritize faster and more efficient operations.
- Dependency Resolution: It is a critical aspect of package management to deal with all the dependencies required for the package to work correctly. Though YUM handled dependency resolution admirably, DNF introduced significant enhancements.
- Python 3 Support: YUM was built on Python 2, which was later deprecated in favor of Python 3 due to its enhanced extensibility and functionalities. DNF was developed using Python 3, ensuring perfect alignment with the latest Python language standards.
- Extensibility and Plugin Support: DNF was designed to be more extensible, allowing developers to create custom plugins and extensions to enhance its functionality.
- Improved Error Handling: DNF was introduced with enhanced error handling and reporting, empowering users to seamlessly grasp and troubleshoot any issues that may arise during package management operations.
- Kernel Management: YUM does not allow the removal of kernel packages. While DNF allows for effortless removal of kernel packages, including the currently running one.
- Forward Compatibility: As YUM is widely used and a number of scripts (including the one deprecated) have been written for it, DNF ensures backward compatibility with YUM.
The introduction of DNF was a gradual process that initially coexisted with CentOS 7 and was eventually adopted as the default package manager in CentOS 8 and later versions, including Fedora and Red Hat.
Overall, DNF was a great improvement in package management for RMP-based distributions, overcoming all the limitations of YUM while preserving compatibility and familiarity for existing YUM users.
Should We Use YUM Package Manager?
It totally depends on the Linux distribution you are using. If you’re still running the previous version of CentOS or any other RPM-based Linux distribution, then you don’t have any alternatives unless you manually compile and install DNF for those systems.
However, if you are running modern RPM-based Linux distributions that use the DNF as the default package manager, then it’s totally recommended to go for it.
And as the DNF uses many functionalities and commands from YUM, including the syntax, the same commands can be used with both package managers.
So, the users can seamlessly transition from YUM to the DNF package manager. You can also check the next section to find the similarities between both of these commands.
How to Use YUM in RPM-Based Linux Distributions
Since YUM is not in use anymore and the syntax between YUM and DNF is identical, you can replace “yum
” with “dnf
” and the command will work as expected.
Update the Package List
The following command will update the local package list to ensure you have the latest information about the available packages:
$ sudo yum update #For YUM
$ sudo dnf update #For DNF
Search for Packages
Specify the package name or package related keyword (ex: “nginx
“) in the following command to search it in the system’s repositories:
$ sudo yum search nginx #For YUM
$ sudo dnf search nginx #For DNF
Install Packages
Specify the package name (ex: “nginx
“) you want to install in the following command:
$ sudo yum install nginx #For YUM
$ sudo dnf install nginx #For DNF
List Installed Packages
To list all the installed packages on your system, run:
$ sudo yum list installed #For YUM
$ sudo dnf list installed #For DNF
Remove Packages
Installed packages can be removed by specifying their package name (ex: “nginx
“) in the following command:
$ sudo yum remove nginx #For YUM
$ sudo dnf remove nginx #For DNF
Get Package Info
You can use the following command, followed by the package name (either installed or not), to get detailed information about it:
$ yum info nginx #For YUM
$ dnf info nginx #For DNF
As you can see from the similarities between both of these commands, note that most of the YUM commands can work with DNF but not in reverse order, as DNF also introduced a few other options that did not exist in YUM.
Final Word
I hope you find this article useful. If you have any questions or queries related to this article, please let me know in the comment section.
Till then, peace!
Join The Conversation
Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.