跳转到内容
搜索 CentOS Stream 文档

    浏览当前文档目录

    启用 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 仓库
    $ sudo dnf config-manager --set-enabled crb

    预期输出为空(成功时不打印内容)。确认状态:

    确认 CRB 已启用
    $ dnf repoinfo crb | grep -E 'Repo-id|Repo-status'

    预期输出(实测摘录):

    Repo-id : crb
    Repo-status : enabled

    CRB 是 Stream 的开发包仓库(对应 RHEL 上的 CodeReady Builder),EPEL 的部分源码级依赖从这里取。之后安装 EPEL 的入口包:

    安装 epel-release
    $ sudo dnf install epel-release

    预期输出(关键行,实测摘录):

    Installing:
    epel-release-9-7.el9.noarch

    装完看仓库清单,会看到 EPEL 与 EPEL Next 同时就位:

    查看启用的仓库
    $ dnf repolist

    预期输出(实测摘录,aarch64):

    baseos CentOS Stream 9 - BaseOS
    appstream CentOS Stream 9 - AppStream
    crb CentOS Stream 9 - CRB
    epel Extra Packages for Enterprise Linux 9 - aarch64
    epel-next Extra Packages for Enterprise Linux 9 - Next - aarch64
    epel-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 的经典包):

    验证 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 点版本完全一致的包来源),把它关掉即可:

    关闭 epel-next(可选)
    $ 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 核对可用性