具体问题

在做 YUM 源更新时候,报如下错误:

1
2
3
4
5
6
7
8
9
10
11
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

解决办法

参考:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b111Mx5i4

下载新的 CentOS-Base.repo/etc/yum.repos.d/,然后将 /etc/yum.repos.d/CentOS-Base.repo 中的 $releasever 变量 export 到环境中,赋值为 7(我的是 CentOS 7),改完之后再次 yum update 发现就 OK 了。