CentOS6.5配置阿里云yum源后报错 http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml The requested URL returned error: 404 Not Found

CentOS6.5在配置阿里云yum源后,更新缓存发生报错

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.cloud.aliyuncs.com'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

原因是 http://mirrors.aliyun.com/centos/6/ 下已经没有相关的文件,找不到自然报404

1
2
../
readme 02-Dec-2020 09:00 357

解决方法是改成7即可

1
2
3
4
cd /etc/yum.repos.d
vi CentOS-Base.repo
:%s/$releasever/7/g #将文件中$releasever全部改成7
yum clean all && yum makecache # 清除和缓存
坚持原创技术分享,您的支持将鼓励我继续创作!
0%