解决更新yum源的时候报错404的问题

最近
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
得到的这个yum源报错:

root@ub12:/etc/yum/repos.d# yum makecache
http://mirrors.163.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

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

http://mirrors.163.com/centos/
官网可以看到已经更新到7.x了

点进去7可以看到有repodata/repomd.xml。所以果断把releasever改成7

vi CentOS6-Base-163.repo
:%s/$releasever/7/g

改了后执行yum makecache OK!

你可能感兴趣的:(yum,小技巧)