如何在 RHEL、Rocky 和 ​​Alma Linux 上启用 EPEL 存储

言鼎科技 2023-07-16 194

什么是EPEL

EPEL (Extra Packages for Enterprise Linux) 是 Fedora 团队提供的开放且免费的环境存储服务,为 Linux 发行版提供 100% 的配套软件,包括 RHEL (Red Hat Enterprise Linux)、CentOS Stream、AlmaLinux 和 Rocks of Linux 。


EPEL 项目不属于 RHEL/CentOS,而是专为大型 Linux 发行版而设计,提供许多开源功能(例如监控等)。大多数 EPEL 版本都有 Fedora 存储库。


我们为什么使用 EPEL 存储库?

它提供了大量的开源包,可以通过 Yum 和 DNF 进行配置。

Epel repo 100% 开源且免费使用。

它不提供任何核心重复包,也不存在任何集成问题。

所有 EPEL 软件包都可以通过 Fedora 存储库获得。

如何在 RHEL 9 系统上安装 EPEL 存储

要在任何基于 RHEL 的发行版上安装 EPEL 存储库,请以 root 用户身份登录到您的服务器实例,并根据您的发行版本运行如下所述的命令。


# 订阅管理器存储库 --enable codeready-builder-for-rehel-9-$(arch)-rpms

# dnf 安装 https://dl.fedoraproject.org/pub/epel/epel-latest-release-9.noarch.rpm

# dnf 配置管理器 --set-enabled crb

# dnf 安装 epil-release epil-next-release

# dnf 配置管理器 --set-enabled crb

# dnf 安装 epel-release

如何在 RHEL 8 系统上安装 EPEL 存储


要使用基于 RHEL 8 的版本协议配置 EPEL 存储,请使用:


# 订阅管理器存储库 --enable codeready-builder-for-rehel-8-$(arch)-rpms

# dnf 安装 https://dl.fedoraproject.org/pub/epel/epel-latest-release-8.noarch.rpm

# dnf 配置管理器 --set-enabled powertools

# dnf 安装 epel-release

# dnf 配置管理器 --set-enabled powertools

# dnf 安装 epel-release

如何在 RHEL 7 系统上安装 EPEL 存储

#subscription-manager repos --enable rhel-*-可选-rpms\

                           --启用 rhel-*-extra-rpms\

                           --启用 rhel-ha-for-rel-*-server-rpms

# 百胜安装 https://dl.fedoraproject.org/pub/epel/epel-latest-release-7.noarch.rpm

# yum 安装 epel-release

# yum 安装 epel-release

如何验证 EPEL 存储库?

现在,使用以下命令更新软件并验证 EPEL 存储库的安装。


# 百胜更新

# rpm -is | 格雷普·埃佩尔


您还可以通过使用以下命令注册所有活动存储来验证系统上是否启用了 EPEL 存储。


# 百胜重新发布


要列出 EPEL 存储库的软件,请运行命令。


# dnf --disablerepo="*" --enablerepo="epel" 可用列表

或者

# yum --disablerepo="*" --enablerepo="epel" 可用列表


或者,您可以使用以下 grep 命令来搜索单个包名称,如图所示。


# yum --disablerepo="*" --enablerepo="epel" 可用列表 | grep 'htop'

或者

# dnf --disablerepo="*" --enablerepo="epel" 可用列表 | grep 'monitorix'


如何使用EPEL Repo安装软件包?

成功安装 EPEL 存储库后,可以使用该命令加载包。


# dnf --enablerepo="epel" 安装 <package_name>

或者

# yum --enablerepo="epel" install <package_name>

例如,要查找并安装名为 htop 的软件包(交互式 Linux 进程查看器),请运行以下命令。


# yum --enablerepo=apel 信息 htop


现在,要安装 Htop 软件包,命令将是。


# yum --enablerepo=epel 安装 htop


注意:EPEL 配置文件位于 /etc/yum.repos.d/epel.repo 下。


在本文中,您了解了如何在基于 RHEL 的分区上安装 EPEL 存储。欢迎您尝试一下,并在下面的评论部分分享您的想法。

言鼎科技

The End