尝试在 Centos 6 上启用 EPEL,但它不会在 repolist 中显示

010*_*101 7 yum

当我运行时yum repolist,我没有看到列出了 EPEL。

# yum repolist

Loaded plugins: downloadonly, fastestmirror, protectbase, refresh-packagekit,
              : security
Loading mirror speeds from cached hostfile
 * base: centos.mia.host-engine.com
 * extras: mirror-centos.hostingswift.com
 * updates: centos-mirror.jchost.net
0 packages excluded due to repository protections
repo id                        repo name                                  status
base                           CentOS-6 - Base                            6,518
extras                         CentOS-6 - Extras                             35
updates                        CentOS-6 - Updates                           209
repolist: 6,762
Run Code Online (Sandbox Code Playgroud)

我跟着http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html

这些说明向我展示了如何安装 RPM 和 GPG 密钥。我做过的:

# sudo rpm -Uvh http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
Retrieving http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.
rpm
Preparing...                ########################################### [100%]
        package epel-release-6-8.noarch is already installed
Run Code Online (Sandbox Code Playgroud)

Bra*_*ley 9

你确定启用了吗?如果未启用存储库,则它不会显示在repolist. 检查中的文件/etc/yum.repos.d/*.repo

例如:

[root@xxx01 ~]# yum repolist 2>&1 | grep epel
epel                                      EPEL Repo                       11,148
Run Code Online (Sandbox Code Playgroud)

显示已安装并列出了 EPEL,repolist因此我将其禁用并检查repolist再次:

[root@xxx01 ~]# sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/epel.repo
[root@xxx01 ~]# yum repolist 2>&1 | grep epel
[root@xxx01 ~]#
Run Code Online (Sandbox Code Playgroud)

编辑:

您还可以使用--enablerepo覆盖存储enabled库配置中的设置的选项临时启用存储库。