启用 EPEL 与 EPEL Next 仓库
适用:CentOS Stream 9 / 10 · 核对日:2026-11-01 · 官方依据:EPEL 官方文档:EOL 的 EL9 与容器内 epel-release 包自带仓库文件。
EPEL 是 EL 生态最大的第三方仓库。Stream 用户要多知道一件事:EPEL 官方把 Stream 当作 EPEL Next 的构建目标,所以 Stream 上装完 epel-release 后会有两条主仓库同时启用。本页流程在 Stream 9 容器实测(aarch64,epel-release-9-7.el9)。
- 一个能访问公网的 Stream 9/10 系统;
- 回退点:本页所有动作都可以用
dnf remove epel-release && dnf config-manager --set-disabled crb回退;仓库文件由 epel-release 包携带,卸载即清。
步骤:先 CRB,再 EPEL
Section titled “步骤:先 CRB,再 EPEL”$ sudo dnf config-manager --set-enabled crb预期输出为空(成功时不打印内容)。确认状态:
$ dnf repoinfo crb | grep -E 'Repo-id|Repo-status'预期输出(实测摘录):
Repo-id : crbRepo-status : enabledCRB 是 Stream 的开发包仓库(对应 RHEL 上的 CodeReady Builder),EPEL 的部分源码级依赖从这里取。之后安装 EPEL 的入口包:
$ sudo dnf install epel-release预期输出(关键行,实测摘录):
Installing: epel-release-9-7.el9.noarch装完看仓库清单,会看到 EPEL 与 EPEL Next 同时就位:
$ dnf repolist预期输出(实测摘录,aarch64):
baseos CentOS Stream 9 - BaseOSappstream CentOS Stream 9 - AppStreamcrb CentOS Stream 9 - CRBepel Extra Packages for Enterprise Linux 9 - aarch64epel-next Extra Packages for Enterprise Linux 9 - Next - aarch64epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - aarch64/etc/yum.repos.d/ 里新增五个文件:epel.repo、epel-next.repo、epel-testing.repo、epel-next-testing.repo、epel-cisco-openh264.repo。装一个包验证 EPEL 真的可用(htop 是 EPEL 的经典包):
$ sudo dnf install htop实测在 epel 仓库解析到 htop-3.3.0-1.el9.aarch64。
理解 EPEL Next:它是干什么的、要不要关
Section titled “理解 EPEL Next:它是干什么的、要不要关”EPEL 主仓库的包针对已发布的 RHEL 点版本构建;EPEL Next 针对的是 CentOS Stream 里的下一个点版本构建——也就是说它假设你的系统明天就会更新到下一个 RHEL 小版本。EPEL 官方文档的建议是:
- 默认从 epel 主仓库装包;
- 只有当主仓库没有某个包、或你需要针对 Stream 新 ABI 的构建时,才用 epel-next。
如果你不想让 epel-next 参与依赖解析(比如追求与 RHEL 点版本完全一致的包来源),把它关掉即可:
$ sudo dnf config-manager --set-disabled epel-next$ sudo dnf remove epel-release$ sudo dnf config-manager --set-disabled crb$ sudo dnf clean all回退后 dnf repolist 应只剩 baseos / appstream(外加你另行启用的仓库)。
| 现象 | 原因 | 处理 |
|---|---|---|
| 装 epel-release 报依赖解析失败 | 没先启用 CRB | 先 --set-enabled crb 再装 |
| 想要的包 epel-next 里有、epel 里没有 | 该包针对下一个点版本构建 | 确认接受后从 epel-next 装 |
| EPEL 下载慢 | EPEL 走 Fedora 的 metalink,与 CentOS 镜像无关 | 按 EPEL 镜像列表改 epel.repo 的 baseurl |
| Stream 10 上 epel-next 缺包 | EPEL Next 对 10 的构建仍在补齐 | 用 dnf repoquery --enablerepo=epel-next 核对可用性 |
- 仓库与滚动内容 — baseos / appstream / crb 的完整说明
- 切换国内镜像源 — centos.repo 的镜像切换(EPEL 是另一套地址)
- 滚动更新排障 — 仓库冲突类报错的排查
- 官方:EPEL 文档、EPEL Next 说明