Linux

What are the differences between dnf and apt package managers?

Feature-Image-DNF-vs-APT

DNF? if you have used fedora before, I didn’t quite surprise you but for Centos or RHEL users, DNF (Dandified Yum) is an updated and better version of yum. DNF is a software package manager for Red Hat Package Management -based Linux distro that installs, updates, and removes packages. APT which is the acronym for advanced packaging tool is the main package manager for Debian-based distributions like Ubuntu. At the end of the day, whether it is APT or DNF you are using, they both help us achieve the same objective, which is to be able to install, update, and remove packages. Just in case, if everything is new to you and you don’t know what yum stands for, it is the acronym for YellowDog Updater Modified. Some other guides can be found in the link: How to install-lxc-lxd-for-container-management-linux-container/, how to configure-user-resource-limits-and-restrictions-in-linux/, and Practical use of-selinux-in-production-how-to-locate-directory-file-context-and-restore-it-with-selinux/.

DNF tries to keep Yum's CLI compatibility and specifies a tight API for extensions and plugins. Plugins can change or extend DNF's capabilities, as well as give more CLI commands

My issues with YellowDog Updater Modified

  • Built with python and as such has its own performance issues
  • Very memory intensive
  • Not enough information especially when one run into issues and decides documentation is the next resort
  • Dependency reliant and most often throw its own issues

Why you Should use DNF

  • DNF has more robust features and functionalities than yum.
  • For DNF there are a lot of repositories to get help and support from.
  • Not as memory intensive as yum
  • It is compatible with Python 2 & 3
  • It has all the beautiful behaviors that you know with RPM
  • Can be located in  /etc/dnf/dnf.conf
  • Faster than yum

Installation of DNF

To install DNF on RHEL/CentOS 7 systems, you need to set up and enable Epel YUM REPO before installing DNF.

1.# yum install epel-release
2.#yum install DNF

Some useful information about the Apt command

On Ubuntu Debian and associated Linux distributions, apt is a command-line tool for installing, updating, removing, and managing deb packages. It combines the most common commands from the apt-get and apt-cache tools, as well as alternative default values for the several choices.

Apt is made for user interactivity. In your shell scripts, users can still use apt-get and apt-cache although apt alone will still get the job done because they are backward compatible

Some examples of dnf vs apt use case

#dnf install <package name>

e.g dnf install httpd

dnf-install-httpd-1

So as you can see you all you need do is just type dnf in place of where you used to type yum

#apt install <package name>

e.g apt install nmap

apt-install-nmap
#dnf upradge <package name >

e.g dnf upgrade nmap

updated
#apt upgrade <package name >

e.g apt upgrade nmap

dnf search httpd
dnf-search

Interesting differences between DNF & APT

DNF APT
Dandified YumAdvanced Package Tool
works with .rpm package formatworks with .deb package format
dnf is the front-end of RPM apt is the front end of DPKG
dnf updates the repo lists automaticallyapt update gets all information from configured source
dnf is used in RHEL, Fedora, CentOS, and other derivatives pf RHELapt is used in Debian and all its derivatives like Ubuntu, Knoppix, etc.
can download and install from URLs directlycannot download and install from URLs directly, it needs .deb packages
doesn’t support one-click installssupports one-click install
dnf remove <software name>apt remove <software name>
dnf upgradeapt upgrade
dnf was first introduced in Fedora in the year 2013first stable version of apt was released in the year 2014
dnf vs apt table

Summary

Dnf and apt are package managers as they help with the update, installation, and removal of packages. These two package managers, being the most popular, basically mimic each other’s most essential syntactical elements, allowing transitioning between them a breeze.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Kindly subscribe to TechDirectArchive
This is default text for notification bar