如何在CentOS和RHEL中启用或设置EPEL存储库

EPEL代表“企业Linux的额外软件包,顾名思义,epel为RHEL,CentOS,Scientific Linux(SL)和Oracle Enterprise Linux(OLE)提供了其他rpm软件包。 EPEL由Fedora社区创建和维护,EPEL软件包是100%免费/自由的开源软件(FLOSS)。

在这篇文章中,我们将讨论如何在CentOS / RHEL 5.X / 6.X / 7.X中启用epel存储库。

对于CentOS 5.X / RHEL 5.X

打开终端并成为root用户,然后执行以下命令:

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

对于CentOS 6.X / RHEL 6.X

以超级用户身份打开终端执行以下命令。

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

对于CentOS 7.X / RHEL 7.X

以root用户打开终端执行以下命令

对于64位操作系统

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
or
# yum install epel-release

注意 :EPEL存储库文件位于“ /etc/yum.repos.d/epel.repo”下

列出新的存储库

[[email protected] ~]# yum repolist 
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.nbrc.ac.in
 * epel: ftp.jaist.ac.jp
 * extras: mirror.nbrc.ac.in
 * updates: mirror.nbrc.ac.in
repo id            repo name                                                 status
base/7/x86_64      CentOS-7 - Base                                           8,465
epel/x86_64        Extra Packages for Enterprise Linux 7 - x86_64            6,349
extras/7/x86_64    CentOS-7 - Extras                                         75
updates/7/x86_64   CentOS-7 - Updates                                        1,127
repolist: 16,016

列出EPEL软件包:

[[email protected] ~]# yum --disablerepo="*" --enablerepo="epel" list available

样本输出

获取包装信息

[[email protected] ~]# yum --enablerepo=epel info htop
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.nbrc.ac.in
 * epel: ftp.jaist.ac.jp
 * extras: mirror.nbrc.ac.in
 * updates: mirror.nbrc.ac.in
Available Packages
Name        : htop
Arch        : x86_64
Version     : 1.0.3
Release     : 3.el7
Size        : 87 k
Repo        : epel/x86_64
Summary     : Interactive process viewer
URL         : http://hisham.hm/htop/
License       : GPL+
Description : htop is an interactive text-mode process viewer for Linux, similar to
            : top(1).

从epel repo安装软件包。

[[email protected] ~]# yum --enablerepo=epel install htop

Sidebar