【问题标题】:Installing EPEL repository on Centos 7 breaks yum functionality? [closed]在 Centos 7 上安装 EPEL 存储库会破坏 yum 功能? [关闭]
【发布时间】:2018-06-27 11:59:03
【问题描述】:

所以我正在尝试设置一个 ssh 堡垒服务器,但我在设置 EPEL 以安装 Python3.6 时遇到问题。

我正在使用CentOS Linux release 7.4.1708 (Core)

所以我尝试先安装 EPEL 使用 sudo yum -y install epel-release(我之前当然做过sudo yum -y update,效果很好),但它告诉我Package 'epel-release' not found

因此我尝试了使用 RedHat Package Manager 的不同方法:

sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

这会成功安装包,我可以在etc/yum.repos.d 中看到epel.repoepel-testing.repo(我在帖子末尾复制了它们的包含)

但是,现在,每当我尝试使用 yum 做某事时,无论是更新还是安装某些软件包,它都会给我以下错误(例如,我使用了 yum -y install Python3.6 或者我也尝试安装 tsclient 或 python-pip):

[root@scw-39016b yum.repos.d]# yum install -y Python3.6
Loaded plugins: fastestmirror
base                                                     | 3.6 kB     00:00
centos-kernel                                            | 2.9 kB     00:00
epel/armhfp/metalink                                     |  42 kB     00:00
Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=armhfp error was
No repomd file


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

File /var/cache/yum/armhfp/7/epel/metalink.xml does not exist

我已经尝试了数百万种方法来解决这个问题,但似乎没有任何帮助:(

我重新安装了 5 次,我已经完成了 sudo yum clean all,我尝试在 repo 文件和其他方式中取消注释 baseurl 并评论 metalink 等等...,但没有任何帮助:(

谁能告诉我,是什么导致了这个错误?

我在某处读到它可能与启用/禁用某些存储库有关,但我不明白如何处理它..

非常感谢!!!

epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

epel-testing.repo

[epel-testing]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug
baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/testing/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

【问题讨论】:

    标签: linux centos yum epel


    【解决方案1】:

    我们通过更新 curl 解决了这个问题。我相信 yum 在后台使用 libcurl,而且似乎旧版本的 curl 无法协商到 epel 存储库的 TLS 连接。

    yum update curl --disablerepo=epel
    

    【讨论】:

    • 它在我的情况下不起作用。更新 curl yum 后仍然无法正常工作。你知道其他解决方案吗?
    • 我在这个月前放弃了,所以我无法收到完整的错误消息,但它类似于:“配置的存储库之一失败(未知),并且 yum 没有足够的缓存数据继续。在这一点上,yum 唯一能做的安全的事情就是失败。有几种方法可以“修复”这个:“然后是帖子中的这 5 个步骤。
    【解决方案2】:

    您正在使用 armhfp 作为您的拱门,并且您正在查看的 epel metalink 中没有它的 repo。

    如果您下载下面的链接,您将获得一个名为 metalink 的文件。您将看到没有与 repo=epel-7&amp;arch=armhfp 匹配的 repo。这是问题的根源。

    https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=armhfp
    

    您需要使用其他一些为armhfp arch 提供 CentOS-7 支持的镜像。

    例如,http://mirror.centos.org/altarch/7/os/armhfp/

    为了使用它,您需要删除epel-release RPM 并安装以下内容:

    rpm -ivh http://mirror.centos.org/altarch/7/os/armhfp/Packages/centos-userland-release-7-4.1708.el7.centos.0.1.armv7hl.rpm
    

    然后为您的包裹发送yum install

    【讨论】:

    • 您好,谢谢您的建议,我已经删除了 epel-release 然后使用了这个命令,但是它告诉我这个包已经安装了 ''package centos-userland-release-7-4.1708 .el7.centos.0.2.armv7hl(比 centos-userland-release-7-4.1708.el7.centos.0.1.armv7hl 更新)已经安装'' .... 因此没有解决我的问题,因为 yum install 仍然为所有内容返回 ''No package available''。还有其他想法吗?
    • 这个答案是否解决了功能损坏的问题?你想安装什么包,你检查过repo是否有那个包吗?您可以搜索其他可能包含您的软件包并支持您的架构的 repo。
    • 我的拱门是 x86_64,我有同样的问题,在问题中有所描述。
    【解决方案3】:

    我在虚拟机上遇到了这个问题。我刚刚更改了 metalink https 访问并将其设置为标准 http,如下所示: metalink=http://mirrors.fedoraproject.org....

    【讨论】:

    • 谢谢。这个对我有用,警告说 RPMDB 在回购之外发生了改变。不知道会不会有什么问题。但我测试了一个有效的包安装。
    • 虽然这似乎可以解决问题,但它也让您容易受到 MITM 攻击。
    【解决方案4】:

    当我尝试在我的 Raspberry Pi 3(新运行的 CentOS 7)上安装 Python3 时,我遇到了您的问题。经过一番 google-fu,我遇到了this site,它帮助我在 armhfp 上安装了 EPEL。 它是这样说的:

    如何在 armhfp 上启用 EPEL 7?

    从某种意义上说答案很简单,没有官方的 EPEL armfhp 的存储库。但是因为很多用户都在问这个, 我们决定使用 centos armhfp 构建器来(重新)构建源 来自 EPEL 7 的包(并尝试自动跟踪) 他们闲着。请注意,这只是一个自动重建,没有 任何 QA/测试,以及由此产生的 pkgs 也没有签名。使用它 存储库,像这样继续:

    cat > /etc/yum.repos.d/epel.repo << EOF
    [epel]
    name=Epel rebuild for armhfp
    baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
    enabled=1
    gpgcheck=0
    
    EOF
    

    按照这些步骤我能够成功运行sudo yum install epel-release,然后在我的树莓派上安装python3。

    在你这样做之前,你需要让 yum 工作。我不确定我是不是最好的帮助,但我建议删除(或至少禁用)您拥有的当前版本的 epel 存储库。

    yum remove epel
    yum remove epel-release
    yum remove epel-testing
    

    您启用的第 3 方存储库似乎已损坏。这会导致您的 yum 出现问题,这就是您需要删除或禁用存储库的原因。

    【讨论】:

    • 我的拱门是 x86_64,我有同样的问题,在问题中有所描述。
    【解决方案5】:

    我们有一个非常相似的问题,我已经看到了几个请求帮助,最常见的回答是“不要使用‘https’,但这会让你受到 MITM 攻击”。必须有更好的答案。

    我们刚刚在服务器上全新安装了 CentOS Linux 版本 7.7.1908(核心),并且每次尝试 sudo yum install epel-release 时都像 OP 一样,我们会破坏 yum。

    这里是安装:

    -bash-4.2$ sudo yum install epel-release
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.sonic.net
     * extras: mirror.fileplanet.com
     * updates: mirror.fileplanet.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package epel-release.noarch 0:7-11 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ===================================================================================================================================================================================================================================
     Package                                                     Arch                                                  Version                                             Repository                                             Size
    ===================================================================================================================================================================================================================================
    Installing:
     epel-release                                                noarch                                                7-11                                                extras                                                 15 k
    
    Transaction Summary
    ===================================================================================================================================================================================================================================
    Install  1 Package
    
    Total download size: 15 k
    Installed size: 24 k
    Is this ok [y/d/N]: y
    Downloading packages:
    epel-release-7-11.noarch.rpm                                                                                                                                                                                |  15 kB  00:00:00     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : epel-release-7-11.noarch                                                                                                                                                                                        1/1 
      Verifying  : epel-release-7-11.noarch                                                                                                                                                                                        1/1 
    
    Installed:
      epel-release.noarch 0:7-11                                                                                                                                                                                                       
    
    Complete!
    

    现在,即使我们只是尝试运行 yum list 也会失败:

    -bash-4.2$ yum list
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    
    
     One of the configured repositories failed (Unknown),
     and yum doesn't have enough cached data to continue. At this point the only
     safe thing yum can do is fail. There are a few ways to work "fix" this:
    
         1. Contact the upstream for the repository and get them to fix the problem.
    
         2. Reconfigure the baseurl/etc. for the repository, to point to a working
            upstream. This is most often useful if you are using a newer
            distribution release than is supported by the repository (and the
            packages for the previous distribution release still work).
    
         3. Run the command with the repository temporarily disabled
                yum --disablerepo=<repoid> ...
    
         4. Disable the repository permanently, so yum won't use it by default. Yum
            will then just ignore the repository until you permanently enable it
            again or use --enablerepo for temporary usage:
    
                yum-config-manager --disable <repoid>
            or
                subscription-manager repos --disable=<repoid>
    
         5. Configure the failing repository to be skipped, if it is unavailable.
            Note that yum will try to contact the repo. when it runs most commands,
            so will have to try and fail each time (and thus. yum will be be much
            slower). If it is a very temporary problem though, this is often a nice
            compromise:
    
                yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
    
    Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
    

    这里是 /etc/yum.repos.d/epel.repo:

    -bash-4.2$ cat epel.repo
    [epel]
    name=Extra Packages for Enterprise Linux 7 - $basearch
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    
    [epel-debuginfo]
    name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    gpgcheck=1
    
    [epel-source]
    name=Extra Packages for Enterprise Linux 7 - $basearch - Source
    #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    gpgcheck=1
    

    那么问题是我们尝试访问的存储库还是我们尝试使用“https”协议访问的事实?如果是前者,我如何找到正确的存储库?如果是后者,我们如何诊断潜在问题?这是一个全新的安装——我们真正做的只是安装了autos 并安装了主目录,安装了rvm 并创建了一些用户和组。

    FWIW,yum check-update 没有报告任何事情,yum update curl(有或没有“--disablerepo=epel”)也没有做任何事情。

    我已经为此苦恼了一天,需要专业的帮助。 ;-/

    这个难题还有另一部分,这就是为什么我怀疑根本问题与“https”有关。我们遇到了这个问题,为什么尝试使用这些说明安装 MongoDB:https://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-red-hat/#using-rpm-packages-recommended

    我们用内容创建了/etc/yum.repos.d/mongodb-org-4.0.repo

    [mongodb-org-4.0]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
    

    然后尝试安装 MongoDB 并得到了一些不同的错误:

    -bash-4.2$ sudo vi /etc/yum.repos.d/mongodb-org-4.0.repo
    -bash-4.2$ sudo yum install -y mongodb-org
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.keystealth.org
     * extras: mirror.fileplanet.com
     * updates: mirrors.sonic.net
    https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
    Trying other mirror.
    It was impossible to connect to the CentOS servers.
    This could mean a connectivity issue in your environment, such as the requirement to configure a proxy,
    or a transparent proxy that tampers with TLS security, or an incorrect system clock.
    You can try to solve this issue by using the instructions on https://wiki.centos.org/yum-errors
    If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
    
    
    
     One of the configured repositories failed (MongoDB Repository),
     and yum doesn't have enough cached data to continue. At this point the only
     safe thing yum can do is fail. There are a few ways to work "fix" this:
    
         1. Contact the upstream for the repository and get them to fix the problem.
    
         2. Reconfigure the baseurl/etc. for the repository, to point to a working
            upstream. This is most often useful if you are using a newer
            distribution release than is supported by the repository (and the
            packages for the previous distribution release still work).
    
         3. Run the command with the repository temporarily disabled
                yum --disablerepo=mongodb-org-4.0 ...
    
         4. Disable the repository permanently, so yum won't use it by default. Yum
            will then just ignore the repository until you permanently enable it
            again or use --enablerepo for temporary usage:
    
                yum-config-manager --disable mongodb-org-4.0
            or
                subscription-manager repos --disable=mongodb-org-4.0
    
         5. Configure the failing repository to be skipped, if it is unavailable.
            Note that yum will try to contact the repo. when it runs most commands,
            so will have to try and fail each time (and thus. yum will be be much
            slower). If it is a very temporary problem though, this is often a nice
            compromise:
    
                yum-config-manager --save --setopt=mongodb-org-4.0.skip_if_unavailable=true
    
    failure: repodata/repomd.xml from mongodb-org-4.0: [Errno 256] No more mirrors to try.
    https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized.”
    

    但是,现在如果我尝试这个,我会收到“(未知)”错误。

    这很混乱。

    【讨论】:

    • 我对 epel-release-7-11 有同样的问题。不幸的是,您的帖子不是答案:(
    【解决方案6】:

    我遇到了同样的问题,为了解决它,我做了以下操作:

    $ yum install epel-release
    $ cd /etc/yum.repos.d
    $ rm epel-testing.repo
    $ yum clean all
    $ yum update -
    

    它对我有用!

    【讨论】:

    • 为我工作,但需要注意的是我不必完全删除 epel-testing.repo,而只需删除 https -> http,正如@guy-b 所说的那样
    【解决方案7】:

    问题是,即使我们是通过rpm安装epel,epel.repoepel-testing.repo文件中配置的baseurl路径也是无效的,因为https://download.fedoraproject.org/ 不存在。
    有效路径为:https://dl.fedoraproject.org/pub/

    因此修改 /etc/yum.repos.d/epel.repo 中的基本网址:baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch

    到这里:
    baseurl=http://dl.fedoraproject.org/pub/epel/7/$basearch

    【讨论】:

    • 在您的屏幕截图中,您故意/错误地/手动从epel7 中删除了l。当然,这会产生一个无效的 URL。
    【解决方案8】:

    这就是我所做的

    sudo nano /etc/yum.repos.d/epel.repo

    注释掉metalink,留下现有的baseurl注释掉。

    name=Extra Packages for Enterprise Linux 7 - $basearch
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
    #metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    

    可以移除 {

    [epel-debuginfo]
    name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
    #metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    gpgcheck=1
    
    [epel-source]
    name=Extra Packages for Enterprise Linux 7 - $basearch - Source
    #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
    #metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    gpgcheck=1
    

    }

    添加一个新的baseurl

    baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/

    保存文件 须藤百胜更新

    我能够让 epel 存储库更新和下载,并检查是否使用 yum install epel-release 安装了 epel-release,我收到了已安装软件包的消息。更新:将 gpgcheck=1 更改为 0 应该没问题。我还删除了 gpgkey= 行。

    如果有帮助请告诉我!

    [续] 当我安装 htop.armv7h1 时,我必须使用 yum 执行 --nogpgcheck 并且它安装得很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-05
      • 1970-01-01
      • 2012-03-14
      • 2012-09-10
      • 1970-01-01
      • 1970-01-01
      • 2021-05-10
      • 2022-01-14
      相关资源
      最近更新 更多