美文网首页
CentOS-6.5更新源

CentOS-6.5更新源

作者: 先生_吕 | 来源:发表于2017-11-10 11:50 被阅读157次

问题

LZ今天在用yum给虚拟机安装FTP服务时发现yum无法正常使用,问题如下:

[root@hadoop ~]# yum install vsftpd
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
http://centos.ustc.edu.cn/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://ftp.sjtu.edu.cn/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirror.lzu.edu.cn/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
2017-11-10_113036.png

很明显这样centOS的源更新了,未找到对应的源

解决(寻找对应centOS版本的源)

1、进入yum源配置目录
cd /etc/yum.repos.d
2、备份原来的yum源,便于恢复
mv CentOS-Base.repo CentOS-Base.repo.bk
2017-11-10_113445.png

注意:这里repo文件好几个,但是base最重要的,所以只需备份base即可

3、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
//更新为阿里云的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

//更新为163的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

//更新为搜狐的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
2017-11-10_113755.png
4、运行yum makecache生成缓存
yum clean all
yum makecache
2017-11-10_113945.png

相关文章

网友评论

      本文标题:CentOS-6.5更新源

      本文链接:https://www.haomeiwen.com/subject/dycbmxtx.html