首页 » 信息技术 »

CentOS8启用DNF包管理工具

2019年11月12日 / 1次阅读
CentOS

DNF包管理工具介绍

CentOS8启用了DNF作为系统软件包管理工具,Yum也不是被放弃,因为DNF应该说是Yum的一个更新的版本。

DNF stands for Dandified yum. DNF is a software package manager for RPM-based Linux distributions such as Fedora, RHEL and CentOS. It is the next upcoming major version of Yum. DNF is first introduced in Fedora and has replaced to become the default package manager of the Fedora distributions. DNF is same as Yum that installs, updates and removes packages on RPM based Linux systems. DNF is introduced for improving the bottlenecks of Yum such as performance, Memory usages, Dependency resolution, speed, and some other factors. The latest stable release of DNF is 1.0 and it is written in Python.

DNF是Dandified yum的缩写,DNF三个字母却没有一个来自yum。DNF也是基于RPM的包管理工具,其首先在Fedora系统中出现,已经成为Fedora系统的默认的包管理工具。现在又来到了CentOS,应该说使用CentOS是幸运的,因为其相对保守的特性。尝鲜的事情,就给Fedora系统吧。DNF的出现,是为了解决Yum系统的性能瓶颈,优化内存使用,依赖关系解析,执行速度等。DNF是用Python写的。

dnf --help,查看你能够使用的命令参数,跟yum差不多。

DNF的优势

1) DNF comes with a simplified code: DNF has about 29000 lines of code compared to over 59000 in yum.

DNF代码比Yum要简单,只有不到3万行代码,而Yum接近6完行。

2) Support for multiple repositories.

支持多repo。

3) Faster and lesser memory intensive operations compared to yum.

更快,比Yum消耗更少内容。

4) Simple interface.

简单的界面。

5) DNF runs in both Python 2 and Python 3.

6) Simple configuration.

配置简单。

7) DNF has faster dependency resolving speed than yum.

依赖包解析速度更快。

8) RPM consistent behavior.

与RPM一致的行为。

9) C bindings for lower level libraries.

10) Package group support, including multiple-repository groups.

支持对package进行group管理

The default location of DNF configuration file is /etc/dnf/dnf.conf.

DNF的主要命令

$ dnf --help
usage: dnf [options] COMMAND

List of Main Commands:

alias                     List or create command aliases
autoremove                remove all unneeded packages that were originally installed as dependencies
check                     check for problems in the packagedb
check-update              check for available package upgrades
clean                     remove cached data
deplist                   List package's dependencies and what packages provide them
distro-sync               synchronize installed packages to the latest available versions
downgrade                 Downgrade a package
group                     display, or use, the groups information
help                      display a helpful usage message
history                   display, or use, the transaction history
info                      display details about a package or group of packages
install                   install a package or packages on your system
list                      list a package or groups of packages
makecache                 generate the metadata cache
mark                      mark or unmark installed packages as installed by user.
module                    Interact with Modules.
provides                  find what package provides the given value
reinstall                 reinstall a package
remove                    remove a package or packages from your system
repolist                  display the configured software repositories
repoquery                 search for packages matching keyword
repository-packages       run commands on top of all packages in given repository
search                    search package details for the given string
shell                     run an interactive DNF shell
swap                      run an interactive dnf mod for remove and install one spec
updateinfo                display advisories about packages
upgrade                   upgrade a package or packages on your system
upgrade-minimal           upgrade, but only 'newest' package match which fixes a problem that affects your system

DNF最后的这个upgrade-minimal命令,貌似Yum没有,这个命令看着很不错。总之,能用DNS,就不要再用Yum了。

本文链接:https://www.maixj.net/ict/centos8-dnf-23026

相关文章

留言区


前一篇:

栏目精选

云上小悟,麦新杰的独立博客

Ctrl+D 收藏本页

栏目


©Copyright 麦新杰 Since 2014 云上小悟独立博客版权所有 备案号:苏ICP备14045477号-1。云上小悟网站部分内容来源于网络,转载目的是为了整合信息,收藏学习,服务大家,有些转载内容也难以判断是否有侵权问题,如果侵犯了您的权益,请及时联系站长,我会立即删除。

网站二维码
go to top