1.百度中提供的安装办法
yum install epel-release -y
yum install dnf
2. No package dnf available解决办法
运行一下几个命令:
wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/dnf-conf-0.6.4-2.sdl7.noarch.rpm
wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64//dnf-0.6.4-2.sdl7.noarch.rpm
wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/python-dnf-0.6.4-2.sdl7.noarch.rpm
yum install python-dnf-0.6.4-2.sdl7.noarch.rpm dnf-0.6.4-2.sdl7.noarch.rpm dnf-conf-0.6.4-2.sdl7.noarch.rpm
安装之后执行以下命令:
dnf --version
输出:
0.6.4
Repository epel is listed more than once in the configuration
Installed: dnf-0:0.6.4-2.sdl7.noarch at 2018-03-09 11:31
Built : at 2016-10-09 17:18
Installed: rpm-0:4.11.3-25.el7.x86_64 at 2018-01-09 10:21
Built : CentOS BuildSystem <http://bugs.centos.org> at 2017-08-03 03:48
安装成功。