您的位置:首页 > 其它

yum源失效问题 网易 阿里等国内镜像失效

2017-05-12 14:21 1491 查看


yum源失效修正

问题背景:需要搭建git服务器 需要用到yum install ,发现yum源失效 理所当然的去使用以往方案解决

step1: 备份原CentOS-Base.repo 文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak


step2: wget yum源(网易,阿里等都可以) http://mirrors.163.com/.help/centos.html 选择自己的服务器的版本
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo


step3:
yum clean all
yum makecache


报错:



打开网址:http://mirrors.163.com/centos/5/addons/x86_x84/repodata/repond.xml

我们发现,网易的镜像都已经转移了,可以在 http://mirrors.163.com/centos/5]看到readme文件,内容如下:
This directory (and version of CentOS) is depreciated.

CentOS-5 is now past EOL

You can get the last released version of centos 5.11 here:
 http://vault.centos.org/5.11/ 
Please NOTE:  this is not being maintained for security since moving to Vault.
It will have security issues, you should upgrade to a new version instead.


现在的最新镜像是在http://vault.centos.org/这个网址下 

所以我们只需要注释掉mirrolist,同时将baseurl的注释打开并将原url替换为http://vault.centos.org即可 




 

我修改完成之后还是报404错误,结果是由于 $releasever 的值是5,而我的版本是5.11,所以我直接将变量 $releasever
全局替换为5.11,至此问题解决了. 

可以利用命令
rpm -qi centos-release
1

查看$releasever的值 



更新:在给网友解决的时候一直报错,查到原因是他有两个yum源,关闭失效的yum源即可,附修改完的yum源截图,如果是6系统还需要修改gpgkey这个后的值为
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
1





版权声明:本文为CyanSkye文章,欢迎审阅,欢迎转载!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: