CentOS-6.5更新源

問題

LZ今天在用yum給虛擬機(jī)安裝FTP服務(wù)時(shí)發(fā)現(xiàn)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的源更新了,未找到對應(yīng)的源

解決(尋找對應(yīng)centOS版本的源)

1、進(jìn)入yum源配置目錄
cd /etc/yum.repos.d
2、備份原來的yum源,便于恢復(fù)
mv CentOS-Base.repo CentOS-Base.repo.bk
2017-11-10_113445.png

注意:這里repo文件好幾個(gè),但是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、運(yùn)行yum makecache生成緩存
yum clean all
yum makecache
2017-11-10_113945.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容