首页/系统/Linux 运维命令速查/dnf repoquery 精确查询包元数据
本包目录(613 条)

dnf repoquery 精确查询包元数据

repoquery 面向脚本的查询子命令:可用版本、依赖树、文件清单、被谁依赖,比 list/search 更精确。

Linux 运维命令速查系统更新于 2026-10-12
用途查询仓库中包的版本/依赖/文件明细
语法dnf repoquery [选项] 包名
所属dnf(需 repoquery 支持,dnf-plugins-core 提供部分子命令)

常用示例

常用示例
dnf repoquery --available nginx
dnf repoquery --requires nginx | head
dnf repoquery --whatrequires openssl-libs | head
dnf repoquery -l nginx | head
dnf repoquery --installed --qf '%{name} %{version}' | head
--qf 自定义输出格式(%{name})适合生成报表;配合 --available/--installed 过滤来源。

易错点

  • 大仓库上全量 whatrequires 很慢,缩小到具体包名并限制 head
  • dnf4 与 dnf5 的 repoquery 参数细节有差异,脚本先版本探测

数据来源与参考

  • dnf repoquery 文档(dnf-plugins-core / dnf5)
  • man 8 dnf

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌