Package Management In Linux Yum Vs Dnf
Differences between DNF and YUM Package Managers
This article explains the differences between DNF and YUM package managers Package Management In Linux Yum Vs Dnf. Both are very popular in Linux operating system cause of various features and easy of package management options. But first, let’s see what YUM and DNF are.
What is YUM?
YUM stands for YellowDog Updater Modified. This is the package manager used to install, update, or remove software packages on Red Hat Enterprise Linux systems. YUM performs dependency resolution when installing, updating, or removing software packages.
YUM package manager continues to work on RedHat-based Linux 6/7/8/9 (RHEL), CentOS 6/7/8, and OEL 6/7. However, using this package manager is not recommended for newer distributions.
What is Package Management In Linux Yum Vs Dnf?
DNF stands for Dandified YUM and is basically an improved version of the YUM package manager. Provides more functionality when installing, updating, or removing software packages on RedHat-based Linux systems. CentOS 8 provides this package manager by default.
SevenMentor is one of the best Linux Training in Pune. It offers the most advanced and updated syllabus to its students. The faculty at SevenMentor are highly experienced and have a thorough knowledge of the subject.
New Package Manager Needed
If DNF is just an update to YUM, why not update YUM instead of introducing a whole new package manager? I had a problem. These issues include slow performance, excessive memory usage, and slow dependency resolution.
Also, the YUM package manager has 56,000 lines of code, and fixing these issues was not easy. Instead of going through the usual time-consuming trial-and-error process to fix the YUM package manager, a new package manager is introduced that is free from all the problems that existed in its predecessor.
Why use DNF instead of yum?
Ultimately, there are three main reasons that yum was forked to DNF. These reasons were so old and serious that Yum had to go.
- Undocumented API: This meant more work for developers. Developers often had to troll the yum codebase just to be able to write calls to do what they wanted. This meant that development was very slow.
- Python 3: CentOS/RHEL8 is about to move to Python 3 and DNF can run on Python 2 or 3, but Yum is not tolerant of this change.
- 3. Dependency resolution algorithm: This has long been the Achilles heel of the Centos package manager. DNF uses state-of-the-art Satisfiability (SAT)-based dependency solvers. This is the same type of dependency resolver used in Zypper by SUSE and openSUSE.
Simply put, yum is obsolete and no longer holds up to the rigors of the latest CentOS 8 distribution. To purchase a CentOS VPS server, you can visit packages available on Eldernode.
Differences between DNF and YUM
Now that we know why Linux introduced a new package manager, let’s take a look at the differences between these two package managers.
Here’s a side-by-side comparison of the differences between these two package managers for better understanding and clarity. This way you can compare both package managers and learn more about them at the same time.
The following table compares each attribute of the two package managers.
We talked about DNF, which has a better dependency resolution mechanism. Let’s take a quick look at the libraries used by DNF to perform better dependency resolution.
- libsolv: This library is used by the DNF package manager to read repositories and resolve packages.
- hawkeye: This library provides C and Python APIs for libsolv.
- librepo: This library provides C and Python APIs for downloading metadata and packages related to Linux repositories.
- libcomps: This library provides the same functionality in DNF as the YUM package manager’s yum.comps library.
DNF Benefits Let’s take a quick look at some of the benefits that the
DNF Package Management In Linux Yum Vs Dnf offers to both end users and developers.
The end user benefit of moving from YUM to DNF means a more authentic experience. DNF can also provide this reliability because it does a better job of resolving dependencies.
Dependency resolution no longer hangs the system when installing packages. DNF is smarter in that sense and improves the user experience.
Installs or updates are also faster and use less memory while installing packages. This also leads to a better user experience. Especially considering that the YUM package manager is getting slower and slower while the upgrade is running. SevenMentor is one of the best certified Linux Classes in Pune.
For developers, switching to DNF means faster and more reliable work, as all exposed APIs are well documented. Another nice thing about DNF is that C continues to implement DNF. More C-based APIs will be released in the future, like Hawkeye and Librepo. Since C is still widely used, this is a great advantage for development.
DNF Auto Tool:
DNF Auto tool is a CLI replacement for DNF upgrade. Can be run automatically and periodically by systemd timers, cron jobs, etc. for automatic notifications, downloads, or updates.
To get started, install the DNF-automatic rpm and enable the systemd timer unit (dnf-automatic.timer). It works as specified in the default configuration file (that is, /etc/dnf/automatic.conf).
# yum install dnf-automatic
# systemctl enable dnf-automatic.timer
# systemctl start dnf-automatic.timer
# systemctl status dnf-automatic.timer
Other timer units that override the default configuration are listed below. Select the one that meets your system requirements.
- dnf-automatic-notifyonly.timer: Notifies the available updates
- dnf-automatic-download.timer: Downloads packages, but doesn’t install them
- dnf-automatic-install.timer: Downloads and installs updates
Call the Trainer and Book your free demo Class For Linux Call now!!!
| SevenMentor Pvt Ltd.
© Copyright 2021 | SevenMentor Pvt Ltd.