如何在 CentOS 5、CentOS 6 和 CentOS 7 上安装和启用 EPEL Repo

在本教程中,我们将向您展示如何在 CentOS 上安装和启用 EPEL Repo。 对于那些不知道的人,EPEL(Extra Packages for Enterprise Linux) 是由 Fedora 项目以确保为企业用户(例如使用 RHEL、CentOS、Oracle Linux 和 Scientific Linux 的人)提供高质量的第 3 方软件包。 EPEL 是一项社区努力,旨在为基于 RHEL 的发行版创建高质量的附加免费软件包存储库。 设置好 EPEL 存储库后,可以使用 yum 命令安装 close 到 7,000 个 EPEL 包。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单。 我将向您展示逐步安装并在 CentOS 5、CentOS 6 和 CentOS 7 上启用 EPEL 存储库。

先决条件

  • 运行以下操作系统之一的服务器:CentOS Linux。
  • 建议您使用全新的操作系统安装来防止任何潜在问题。
  • 对服务器的 SSH 访问(或者如果您在桌面上,则只需打开终端)。
  • 一种 non-root sudo user或访问 root user. 我们建议充当 non-root sudo user,但是,如果您在充当 root 时不小心,可能会损害您的系统。

在 CentOS 5、CentOS 6 和 CentOS 7 上安装和启用 EPEL Repo

首先,您需要在系统上启用 EPEL 存储库。 您无需在 yum 中手动配置此存储库。 相反,下载以下软件包并安装它,这将在您的系统上启用 EPEL 存储库。

  • CentOS 7 64 位
## RHEL/CentOS 7 64-Bit ## # wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm # rpm -ivh epel-release-7-8.noarch.rpm
  • CentOS 6 64 位
## RHEL/CentOS 6 64-Bit ## # wget https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm
  • CentOS 6 32 位
## RHEL/CentOS 6 32-Bit ## # wget https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm
  • CentOS 5 64 位
## RHEL/CentOS 5 64-Bit ## # wget https://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm # rpm -ivh epel-release-5-4.noarch.rpm
  • CentOS 5 32 位
## RHEL/CentOS 5 32-Bit ## # wget https://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm # rpm -ivh epel-release-5-4.noarch.rpm

要验证 EPEL 存储库是否已成功设置,请运行以下命令以列出系统上所有可用的存储库:

# yum repolist

恭喜! 您已成功安装 EPEL 存储库。 感谢您使用本教程在 CentOS 系统中安装 EPEL 存储库。 如需更多帮助或有用信息,我们建议您查看 EPEL官方网站.

Save

Save