CentOS 的 dnf 命令

列出所有repo文件

dnf repolist all

列出系统所有repo文件

dnf repolist

列出所有软件包(已安装+可用)

dnf list

列出已安装的包

dnf list installed

列出可用的包

dnf list available

列出组包

dnf grouplist

安装组包

dnf groupinstall 'System Tools'

更新组包

dnf groupupdate 'System Tools'

搜索软件包

dnf search httpd

查看某个软件包的详细信息

dnf info httpd

安装软件包

dnf install httpd

重新安装软件包

dnf reinstall httpd

只下载不安装软件包

dnf download httpd

检查所有软件包的更新

dnf check-update

等价于

dnf list --updates

更新所有软件

dnf update

更新指定的包

dnf update httpd

卸载指定的包

dnf remove httpd

去除不再需要的依赖包

dnf autoremove

清理所有缓存

dnf clean all

重建缓存

dnf makecache
原文地址:https://www.cnblogs.com/gebron/p/14515684.html