sudo: dnf: command not found 命令找不到,进行安装


dnf是新一代包依赖管理,取代yum是迟早的,因为yum不支持python3(当然这个不是主要原因)

使用dnf安装的时候提示:

[root@centos7 ~]# sudo dnf install MariaDB-server
sudo: dnf: command not found

安装步骤

安装epel-release依赖

yum install epel-release -y

有点讽刺,用yum来安装

yum install dnf

查看版本

[root@centos7 ~]# dnf --version
4.0.9
  Installed: dnf-0:4.0.9.2-1.el7_6.noarch at Tue 02 Feb 2021 02:18:52 AM CST
  Built    : CentOS BuildSystem <http://bugs.centos.org> at Wed 13 Feb 2019 08:19:33 PM CST

  Installed: rpm-0:4.11.3-43.el7.x86_64 at Wed 05 Aug 2020 07:32:56 AM CST
  Built    : CentOS BuildSystem <http://bugs.centos.org> at Wed 01 Apr 2020 04:21:52 AM CST

原文链接:https://blog.yongit.com/note/891986.html