Differences between YUM and DNF package managers

In this article, we want to discuss what is the differences between YUM and DNF package managers ( Yum vs DNF ).

Let’s see what YUM and DNF package managers are.

What is YUM?

YUM which stands for YellowDog Updater Modified is a package manager used for managing the installation, updating, and removing the software packages in a RedHat-based Linux system.

What is DNF?

DNF which stands for Dandified yum is an updated version of yum. it is work the same as yum. DNF manages the installation, updating, and removal of the software packages with more features in a RedHat-based Linux system.

What are the differences between YUM and DNF package managers

YUM package manager faced some problems such as poor performance, excessive memory usage, and slowdown for dependency resolution, so this decision was made that it replaced with the DNF package manager on Centos8 and AlmaLinux 8 and some RedHat-based Linux systems.

DNF uses “libsolv” for dependency resolution, which is developed and maintained by SUSE to improve performance. and 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 a new tool has been built?

It has been explained that fixing problems aren’t possible technically. Also, the YUM team hasn’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.

Extra differences between YUM vs DNF package manager

no.DNF (Dandified yum)Yum (YellowDog Updater Modified)
1DNF supports various extensionsYUM supports only Python-based extensions
2In the DNF the API is well-documented so it’s easy to create new featuresIn the YUM It is very difficult to create new features because the API is not properly documented
3DNF uses less memory when synchronizing the metadata of the repositoriesYUM uses excessive memory when synchronizing the metadata of the repositories
4dnf update and dnf upgrade are equalbut in the yum it’s different
5The dependencies on package installation are not updated in the DNFYum offered an option for this behavior
6Kernel packages are not protected by dnfwith Yum, you can delete all kernel packages, including one that runs
7When removing a package, dnf automatically removes any dependency packages not explicitly installed by the userYUM didn’t do this
8If the enabled repository does not respond, dnf will skip it and continue the transaction with the available repositoriesIf a repository is not available, YUM will stop immediately
9All performance is good in terms of memory usage and dependency resolution of repository metadata in DNFIn the yum Overall performance is poor in terms of many factors
10By 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.
Comparison of YUM vs DNF

These are the most common differences of YUM vs DNF.

Examples of DNF and Yum Package Manager Commands

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

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

And to automatically remove unneeded dependencies, use:

sudo dnf autoremove

Also, you can use it for YUM.

Most Common useful Commands of DNF and Yum

no.Yum and DNF commandsExplanations
1dnf install package-name
or
yum install package-name
Install a Software package
2dnf upgrade package-name
or
yum upgrade package-name
Upgrade or Update a Software package
3dnf search package-name
or
yum search package-name
It looks for the desired package in the repository
4dnf remove package-name
or
yum remove package-name
Removes the desired package
5dnf info package-name
or
yum info package-name
It gives information about the desired package
6dnf list installed
or
yum list | less
It gives a list of installed packages
Useful Commands of DNF and Yum

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. Hope it is useful for you.

For more articles, you can visit the Orcacore website.

Also, you may be like these articles:

Use YUM and RPM Package Managers on AlmaLinux 8

How To Convert AlmaLinux 8 To Rocky Linux 8

How To Convert Centos 8 to AlmaLinux 8

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular