CentOS-6.5更新源

问题

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容