centos7 安装dnf包管理器和常用命令

Installing DNF

Currently the DNF package comes from the EPEL repository, so if your Linux system is not already configured to use this repository, simply run the command below to set it up.

[root@centos7 ~]# yum install epel-release -y

Now that EPEL is ready to use, simply install the dnf package as shown below.

[root@centos7 ~]# yum install dnf -y

So we’re using a package manager to install a package manager, kind of meta. I was wondering if DNF would attempt to remove Yum during installation, but it did not and it appears that they are capable of working along side each other.

Using DNF

Now that DNF is installed we can use it in place of Yum. Most of the commands appear to be of the same syntax which makes things much easier, for example:

Installing a package

dnf install httpd

Updating a package

dnf update httpd

Viewing history

dnf history

Uninstall a package

dnf remove httpd

Check out the man page for further information.

原文地址:https://www.cnblogs.com/kzwrcom/p/6394016.html