Loading... # CentOS 安装DNF软件包管理器 > DNF,全称Dandified Yum,是RPM发行版的软件包管理器Yellowdog Updater, Modified(yum)的下一代版本。DNF最早出现在Fedora 18中,并在Fedora 22、RHEL8中替代yum。DNF旨在解决部分yum已知的不足之处,包括糟糕的性能、高内存使用、缓慢的迭代拓扑排序。DNF使用了外部依赖解析器libsolv。 # 一、解决依赖 安装DNF ,您必须先安装并启用 epel-release 依赖。 ``` yum install epel-release -y ``` # 二、安装DNF ``` yum install dnf -y ``` # 三、查看DNF版本 ``` dnf --version ``` ``` # dnf --version [11:14:10] 4.2.17 Installed: dnf-0:4.2.17-7.el8_2.noarch at Mon 17 Aug 2020 02:54:24 AM GMT Built : CentOS Buildsys <bugs@centos.org> at Tue 21 Jul 2020 06:47:09 PM GMT Installed: rpm-0:4.14.2-37.el8.x86_64 at Sat 11 Jul 2020 08:42:05 AM GMT Built : CentOS Buildsys <bugs@centos.org> at Fri 24 Apr 2020 03:17:18 AM GMT ``` 这样 DNF 就安装完成了。 # 四、使用 **1. 列举DNF软件库** ``` dnf repolist ``` **2. 查看系统中可用和不可用的所有的 DNF 软件库** 该命令用于显示系统中可用和不可用的所有的 DNF 软件库 ``` dnf repolist all ``` **3. 查看所有 RPM 包** ``` dnf list ``` **4. 查看软件包详情** 当你想在安装某一个软件包之前查看它的详细信息时,这条命令可以帮到你。 ``` dnf info nano ``` ``` # dnf info nano [11:16:55] Repository epel is listed more than once in the configuration Last metadata expiration check: 2:05:50 ago on Sun 01 Nov 2020 09:17:28 AM CST. Installed Packages Name : nano Version : 2.9.8 Release : 1.el8 Architecture : x86_64 Size : 2.2 M Source : nano-2.9.8-1.el8.src.rpm Repository : @System From repo : anaconda Summary : A small text editor URL : https://www.nano-editor.org License : GPLv3+ Description : GNU nano is a small and friendly text editor. ``` End Thanks!😜 最后修改:2020 年 11 月 01 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 0 如果觉得我的文章对你有用,请随意赞赏