插件窝 干货文章 linux epel 是什么

linux epel 是什么

EPEL sudo RHEL 软件包 99    来源:    2025-04-29

EPEL(Extra Packages for Enterprise Linux)是 Enterprise Linux 额外软件包仓库的缩写,是为 Red Hat Enterprise Linux(RHEL)、CentOS、Scientific Linux 等企业级 Linux 发行版提供高质量附加软件包的社区维护项目。

核心特点:

  1. 官方认可

    • 由 Fedora 社区维护,但被 Red Hat 官方认可为可信源。
    • 不替换基础系统包,与官方仓库兼容。
  2. 软件范围

    • 提供 10,000+ 软件包(如 nginxpython3-piphtop)。
    • 覆盖开发工具、系统工具、网络服务等。
  3. 版本匹配

    • 严格对应 RHEL 主版本(如 EPEL-9 对应 RHEL 9)。

安装 EPEL(以 RHEL/CentOS 为例)

# RHEL/CentOS 7/8/9 通用方法:
sudo yum install epel-release  # CentOS 7
sudo dnf install epel-release # CentOS 8/9 或 RHEL

# 或手动启用(适用于无订阅的 RHEL):
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

常见问题解决

  1. 冲突报错

    # 检查冲突包
    sudo yum remove conflicting-package
    # 清理缓存
    sudo yum clean all
    
  2. 启用/禁用 EPEL

    # 临时禁用
    sudo yum --disablerepo=epel install package
    # 永久禁用
    sudo vim /etc/yum.repos.d/epel.repo  # 修改 enabled=0
    
  3. 优先级设置
    安装 yum-plugin-priorities 并配置 /etc/yum.repos.d/epel.repo 中的 priority 数值(数值越小优先级越高)。


典型应用场景

  • 安装开发工具链(如 gcc-c++ 最新版)
  • 获取监控工具(如 zabbix-agent
  • 部署现代服务(如 nodejs16

建议通过 yum search --enablerepo=epel keyword 查找包名后再安装。