首页/系统/Linux 运维命令速查/EPEL/额外仓库管理(dnf config-manager)

EPEL/额外仓库管理(dnf config-manager)

EPEL 等第三方仓库在 RHEL 系很常见:用 config-manager 启用/禁用、加 repo、管优先级,避免「装了打不开」的意外。

Linux 运维命令速查系统更新于 2026-10-12
用途管理第三方/额外仓库的启用状态
语法dnf config-manager --add-repo / --set-enabled
所属dnf-plugins-core

常用示例

常用示例
dnf install -y epel-release
dnf config-manager --set-enabled epel
dnf config-manager --add-repo https://example.com/nexus.repo
dnf repolist
# 优先级(需 dnf-plugin-priority 场景)
# priority=1 最高
优先加 RPM 包 epel-release(含 GPG 与仓库定义),比手写 repo 文件少踩坑。

易错点

  • 第三方仓库长期开启可能把基础包换成版本冲突版本,装完需要的包考虑 disable
  • 加 repo 后没跑 makecache/repolist 验证就安装,404 与 GPG 错误会混在一起难排查

数据来源与参考

  • dnf-plugins-core 文档(config-manager)
  • EPEL 官方说明

相关工具

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