【问题标题】:Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again错误:无法检索存储库的存储库元数据 (repomd.xml):base。请验证其路径并重试
【发布时间】:2019-05-02 21:55:32
【问题描述】:

我遇到了 yum update httpd 的问题

我的服务器是 CentOS 5.11

我得到这个错误:

[root@pbx5 ~]# yum install httpd
Loaded plugins: kmod
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os error was
[Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
http://vault.centos.org/5.11/os/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@pbx5 ~]#

这里是我的仓库 CentOS-Base.repo

name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://vault.centos.org/5.11/os/i386/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://vault.centos.org/5.11/extras/i386/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

请帮助我。 谢谢。

【问题讨论】:

    标签: linux bash centos repository


    【解决方案1】:

    [base]中评论镜像列表:

    [base]
    name=CentOS-$releasever - Base
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    baseurl=http://vault.centos.org/5.11/os/i386/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    

    并检查 vault.centos.org 是否正确解析:

    $ dig +short vault.centos.org
     109.72.83.61
    

    如果没有解决,请尝试手动添加记录:

    echo "109.72.83.61 vault.centos.org" >> /etc/hosts
    yum clean all && yum makecache
    

    【讨论】:

    • 还是一样,先生,我收到此错误Could not retrieve mirrorlist http://mirror.elastix.org/?release=2&amp;arch=x86_64&amp;repo=commercial_addons error was [Errno 4] IOError: &lt;urlopen error (-3, 'Temporary failure in name resolution')&gt; Error: Cannot retrieve repository metadata (repomd.xml) for repository: commercial-addons. Please verify its path and try again [root@pbx5 yum.repos.d]#
    • 现在您多了一个错误的存储库。域 mirror.elastix.org 未解析。运行 grep -Rl mirror.elastix.org /etc/yum.repos.d/ 并在 repo-files 中设置 enabled=0,该域已在其中注明。
    • 还是一样,先生,我收到错误[root@pbx5 ~]# yum install httpd Loaded plugins: kmod Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&amp;arch=x86_64 error was [Errno 4] IOError: &lt;urlopen error (-3, 'Temporary failure in name resolution')&gt; Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again [root@pbx5 ~]#
    • 看起来你有很旧的存储库。使用 HTTPS 而不是 HTTP。尝试使用 https 更改 http://mirrors.fedoraproject.org。将mirrorlist设置为https://mirrors.fedoraproject.org另外,我建议你安装CentOS 7,因为CentOS 5 2年前就已经EOL了。
    • 不幸的是,这是不可能的。 CentOS 7 使用systemd,所以你需要手动迁移所有数据。我们可以修复所有错误,以便您安装 httpd,但某些软件可能已过时。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-08
    • 1970-01-01
    相关资源
    最近更新 更多