Instructions for DNF, the default package manager instead of YUM in CentOS 8


    One of the new features of CentOS 8 is that the familiar YUM package manager has been replaced by DNF. The DNF manager has been used by the Fedora team since Fedora 22, but it was not until CentOS team 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 DNF has been hailed as being more intelligent and futuristic 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. Therefore, if you want to develop, it is very difficult 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. Therefore the transition to DNF is a calculated step for the future.

    • Since YUM is simply outdate (outdated), it is natural for DNF or another alternative: 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 the current packages. The reason will be discussed below.


    Syntax of installing packages using DNF


    dnf install ten_goi

    hoặc

    dnf install -y ten_goi

    For example


    Install the packages using DNF


    dnf install -y vim

    dnf install -y httpd

    Nature of the DNF package manager


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


    Check the path of the yum program with the which command


    (root@centos8srv01 ~)# which yum
    /usr/bin/yum

    Check out the link of /usr/bin/yum


    (root@centos8srv01 ~)# 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 linked from file dnf3


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


     (root@centos8srv01 ~)# which dnf
    /usr/bin/dnf

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


    (root@centos8srv01 ~)# ll /usr/bin/dnf
    lrwxrwxrwx. 1 root root 5 May 14 02:34 /usr/bin/dnf -> dnf-3

    Check the path of /usr/bin/dnf-3


    (root@centos8srv01 ~)# 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 does not link to any file. This is the original file for dnf and yum.


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


    (root@centos8srv01 ~)# ll /etc/yum.conf
    lrwxrwxrwx. 1 root root 12 May 14 02:34 /etc/yum.conf -> dnf/dnf.conf

    Conclude


    So, in the future you should gradually switch to dnfthay instead of yum, because yum is currently linked to dnf already.





    Không có nhận xét nào