无法在 AWS 中通过 yum 安装软件包,[Errno -1] repomd.xml 与 epel 的元链接不匹配

Unable to install packages via yum in AWS, [Errno -1] repomd.xml does not match metalink for epel

虽然通过 yum 运行 安装 rpms 到 AWS EC2 实例中出现以下错误。

sudo yum update
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    epel/x86_64/metalink                                                                                   |  16 kB  00:00:00

     * base: d36uatko69830t.cloudfront.net
     * epel: dl.fedoraproject.org
     * extras: d36uatko69830t.cloudfront.net
     * updates: d36uatko69830t.cloudfront.net
    base                                                                                                   | 3.6 kB  00:00:00

    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirror.es.its.nyu.edu/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://dl.fedoraproject.org/pub/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://d2lzkl7pfhq30w.cloudfront.net/pub/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://mirror.umd.edu/fedora/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://mirror.vcu.edu/pub/gnu%2Blinux/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirror.math.princeton.edu/pub/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://ewr.edge.kernel.org/fedora-buffet/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://iad.mirror.rackspace.com/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://epel.mirror.constant.com/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://fedora-epel.mirrors.tds.net/fedora-epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://download-cc-rdu01.fedoraproject.org/pub/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirror.siena.edu/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://fedora.mirrors.pair.com/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirrors.mit.edu/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirror.metrocast.net/fedora/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://mirror.atl.genesisadaptive.com/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://reflector.westga.edu/repos/Fedora-EPEL/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for
    epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    https://mirror.csis.ysu.edu/fedora/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirror.nodesdirect.com/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
    Trying other mirror.
    epel                                                                                                   | 5.4 kB  00:00:00

    http://mirror.pit.teraswitch.com/fedora/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml 

does not match metalink for epel
        Trying other mirror.
        epel                                                                                                   | 5.4 kB  00:00:00

        https://mirror.us-midwest-1.nexcess.net/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
        Trying other mirror.
        epel                                                                                                   | 5.4 kB  00:00:00

        http://mirror.grid.uchicago.edu/pub/linux/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
        Trying other mirror.
        epel     

无法安装软件包 rpms,它尝试了多个镜像,但最终失败了。 这个问题是从昨天开始发生的,之前它工作正常,不确定 repomd.xml 文件中发生了什么变化。还有其他人面临同样的问题吗?

这似乎是一个更广泛的已知问题,与 repomd.xml 文件中的 timestamp 属性 相关,不同于 revision 属性。

目前的建议如下:

  • 打开 /etc/yum.repos.d/epel.repo 文件。
  • 注释掉 metalink 属性.
  • 取消注释 baseurl 属性。

完成后 运行 yum clean metadatayum clean all.

这应该只在短期内完成,一旦问题得到解决就会恢复。

CentOS 软件包存储库中似乎存在问题。

作为解决方法,您可以手动下载 epel-release 软件包并使用以下命令安装它;

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