linux 包管理工具dnf,CentOS8启用DNF包管理工具

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了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值