【运行报错】CentOS 7.5 yum 源报错:repomd.xml: [Errno 14] HTTP Error 404 - Not Found

1. 报错信息:

yum 源可能会报错

[root@controller ~]# yum makecache
Loaded plugins: fastestmirror
base                                                                     | 5.6 kB  00:00:00     
failure: repodata/repomd.xml from centos-ceph-luminous: [Errno 256] No more mirrors to try.
http://mirror.centos.org/altarch/7/storage/x86_64/ceph-luminous/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.


One of the configured repositories failed (CentOS-7 - Base - 163.com),
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. Disable the repository, 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 base

    4. 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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file

2. 原因分析:

是因为yum已经更新了的原因导致的

3. 解决方法:

看清楚:failure后边的文件名,在对其进行更改

failure: repodata/repomd.xml from centos-ceph-luminous: [Errno 256] No more mirrors to try.
http://mirror.centos.org/altarch/7/storage/x86_64/ceph-luminous/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

  1. 进入yum源 目录

    [root@controller lib]# cd /etc/yum.repos.d
    [root@controller yum.repos.d]# ls
    CentOS-Base.repo      CentOS-Ceph-Luminous.repo  CentOS-Debuginfo.repo  CentOS-Media.repo             CentOS-QEMU-EV.repo  CentOS-Storage-common.repo  CentOS-x86_64-kernel.repo  epel-testing.repo
    CentOS-Base-repo.bak  CentOS-CR.repo             CentOS-fasttrack.repo  CentOS-OpenStack-queens.repo  CentOS-Sources.repo  CentOS-Vault.repo           epel.repo
    
  2. 修改CentOS-Base.repo:

    # 将 所有[子文件]中的 baseurl 中的 $releasever 替换成 7
    [base]
    name=CentOS-$releasever - Base - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/
            http://mirrors.aliyuncs.com/centos/7/os/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/7/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
    
  3. 修改CentOS-Ceph-Luminous.repo:

    # 将 所有[子文件]中的 baseurl 设置为:
    baseurl = http://mirrors.aliyun.com/centos/7/storage/x86_64/ceph-luminous/
    
  4. 修改CentOS-OpenStack-queens.repo:

    # 将 所有[子文件]中的 baseurl 设置为:
    baseurl =http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-queens/
    
  5. 清空 yum 缓存

    yum clean all
    
  6. 重新生成缓存

    yum makecache
    
  7. 更新 yum 源软件包和内核

    yum upgrade –y
    

版权声明:本文为Qmilumilu原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。