Tutorial on DNF, the default package manager instead of YUM in CentOS 8

One of the new features of CentOS 8 is that the familiar package manager YUM has been replaced with DNF. The DNF manager has been used by the Fedora team since Fedora 22 but it has not been until now that the CentOS team has decided to use it. So is there a reason why the community moved from YUM to DNF? When using DNF, do users have to remember more familiar command syntax? All will be summarized in this article.


The reason that DNF was replaced for YUM.


Some of the main reasons that DNF is hailed as being smarter, more future than YUM are as follows:



  • YUM has been developed by the community and has been around for a long time, so in earlier times standardizing YUM API documents was a bit difficult or even worse. So if you want to continue developing, it will be very hard for DEV.

  • DNF supports both python2 and python3, while YUM does not solve this problem. In the future to 2020, python2 also has plans to support. So the move to DNF is a step towards the future.

  • YUM simply outdates (outdated) so it's natural for DNF or another form of replacement: D.


Is it difficult to use DNF?


The answer is NO, because the syntax of DNF inherits or in other words is exactly the same as when using YUM. Therefore users do not need to remember too much, just change yum with dnf is okay.


Note: on CentOS 8 you can still use yum to install packages as you currently know. The reason will be discussed below.


Package installation syntax using DNF


dnf install ten_goi

hoặc

dnf install -y ten_goi

For example


Install packages using DNF


dnf install -y vim

dnf install -y httpd

The essence of the DNF package manager


In essence, the DNF package manager is linked to YUM in CentOS 8. It means you can still use the command. yum install ten_goi to install the necessary packages. We will check this out.


Check the path of the yum program with the which command


[[email protected] ~]# which yum
/usr/bin/yum

Check out the link of /usr/bin/yum


[[email protected] ~]# ll /usr/bin/yum
lrwxrwxrwx. 1 root root 5 May 14 02:34 /usr/bin/yum -> dnf-3

On the above result, we see the nature /usr/bin/yum


is the link from the dnf3 file


Continue to check the path of the dnf package with the which command


 [[email protected] ~]# which dnf
/usr/bin/dnf

And check out the link of /usr/bin/dnf, we have the below result.


[[email protected] ~]# ll /usr/bin/dnf
lrwxrwxrwx. 1 root root 5 May 14 02:34 /usr/bin/dnf -> dnf-3

Next check's path /usr/bin/dnf-3


[[email protected] ~]# ll /usr/bin/dnf-3
-rwxr-xr-x. 1 root root 1954 May 14 02:34 /usr/bin/dnf-3

The above result shows that dnf-3 has no link to any file. This is the original file for the dnf and yum commands.


We can check the other paths of the files related to the yum package


[[email protected] ~]# ll /etc/yum.conf
lrwxrwxrwx. 1 root root 12 May 14 02:34 /etc/yum.conf -> dnf/dnf.conf

Conclude


Thus, in the future you should gradually switch to using dnfth instead of yum, as yum is currently being linked to dnf.


 










































About My name is Nguyen Manh Cuong. I was born in a poor village in Ba Vi district, HA NOI province - windy and sunny land. Currently. https://www.nguyendiep.com/. Mr Cuong.
Newer Posts Newer Posts Older Posts Older Posts

Comments

Post a Comment