Share your love
Differences between YUM and DNF package managers
In this article, we want to discuss what are the differences between YUM (YellowDog Updater Modified) and DNF (Dandified Yum) package managers (Yum vs DNF). As you know, Yum is an old package manager of RHEL-based distros and because of its poor performance and extra memory usage, DNF was introduced as a replacement for Yum in new versions of RHEL-based distros.
At this point, we want to show you the exact meaning of Yum and DNF package managers and discuss the differences. To do this, follow the rest of the article.
What is YUM?
YUM stands for YellowDog Updater Modified. It is a package manager that you can use for the following management processes in a RedHat-based Linux system:
- Install Software Packages
- Update Software Packages
- Remove Software Packages
What is DNF?
DNF stands for Dandified Yum. It is an updated version of Yum and works the same as Yum. It is used for the management processes.
Now follow the steps below to see the differences between Yum and DNF and their most useful commands.
What are the differences between YUM and DNF package managers?
After a time, the YUM package manager faced some problems such as:
- Poor performance
- Extra memory usage
- Slow down in dependency resolution
So this decision was made that Yum replaced with the DNF package manager on Centos 8 and AlmaLinux 8 and some RedHat-based Linux systems such as Rocky Linux and Fedora.
DNF uses “libsolv” for dependency resolution, which is developed and maintained by SUSE to improve performance. It is written in C, C++, and Python.
YUM uses the public API for dependency resolution. and the API is not fully documented. and It is written only in Python.
Here this question is asked why a new tool has been built instead of fixing the problems.
Why DNF has been built?
It has been explained that fixing problems isn’t possible technically. Also, the YUM team isn’t ready to accept the changes.
The big issue is that there are 56K lines for Yum, but only 29K lines for DNF, so there is no way to fix it.
However, Yum still works on RedHat Enterprise Linux 6/7 (RHEL), CentOS 6/7, and OEL 6/7.
It is also used for Centos 8 and Almalinux 8, but it’s recommended to use the DNF package manager instead of YUM.
Let’s see some more differences between DNF and YUM.
YUM vs DNF
no. | DNF (Dandified yum) | Yum (YellowDog Updater Modified) |
1 | DNF supports various extensions | YUM supports only Python-based extensions |
2 | In the DNF the API is well-documented so it’s easy to create new features | In the YUM It is very difficult to create new features because the API is not properly documented |
3 | DNF uses less memory when synchronizing the metadata of the repositories | YUM uses excessive memory when synchronizing the metadata of the repositories |
4 | dnf update and dnf upgrade are equal | but in the yum it’s different |
5 | The dependencies on package installation are not updated in the DNF | Yum offered an option for this behavior |
6 | Kernel packages are not protected by dnf | with Yum, you can delete all kernel packages, including one that runs |
7 | When removing a package, dnf automatically removes any dependency packages not explicitly installed by the user | YUM didn’t do this |
8 | If the enabled repository does not respond, dnf will skip it and continue the transaction with the available repositories | If a repository is not available, YUM will stop immediately |
9 | All performance is good in terms of memory usage and dependency resolution of repository metadata in DNF | In the yum Overall performance is poor in terms of many factors |
10 | By default, ten minutes after the system boots, updates to configured repositories are checked by dnf hourly. This action is controlled by the system timer unit named “/usr/lib/systemd/system/dnf-makecache.timer” | Also for yum too. |
Examples of DNF and Yum Package Manager Commands
At this point, let’s start with one of the first tasks many of us perform after installing a new Linux distro—downloading system updates.
Download System Updates
To install system updates using DNF, run the following command:
sudo dnf update -y Or sudo dnf upgrade -y
To install system updates using YUM, run the following command:
sudo yum update -y
sudo gives you administrative access to your system. Without it, your command will fail with an error message due to a lack of permission.
The update command downloads metadata about the packages from your available software sources so that your computer knows what versions to request.
Search for a Package
At this point, if you want to search for a program with the name “package,” simply type:
sudo dnf search package
sudo yum search package
Install Software
Like with performing a search, the command to install a program using YUM or DNF is the same.
sudo dnf install package
or
sudo yum install package
One advantage of DNF and Yum is the ability to install RPMs that you’ve downloaded manually from the web. You can do so using the same install command but include the full path to the RPM instead of a package name.
sudo dnf install /path/to/package.rpm
or
sudo yum install /path/to/package.rpm
Uninstall Software
To uninstall a program using DNF, run:
sudo dnf remove package
To automatically remove unneeded dependencies, use:
sudo dnf autoremove
Also, you can use it for YUM.
The most common useful Commands
no. | Yum and DNF commands | Explanations |
1 | dnf install package-name or yum install package-name | Install a Software package |
2 | dnf upgrade package-name or yum upgrade package-name | Upgrade or Update a Software package |
3 | dnf search package-name or yum search package-name | It looks for the desired package in the repository |
4 | dnf remove package-name or yum remove package-name | Removes the desired package |
5 | dnf info package-name or yum info package-name | It gives information about the desired package |
6 | dnf list installed or yum list | less | It gives a list of installed packages |
Conclusion
In this article, we try to explain the differences between YUM and DNF. And why it’s better to use DNF instead of YUM. Also, you will learn the most useful commands of them.
Hope you enjoy it. For more articles, you can visit the Orcacore website.
Also, you may like these articles:
Use YUM and RPM Package Managers on AlmaLinux 8