2020年11月30日 centos6各大開源鏡像站已經停止維護了 但是阿里源還是可以用的 因爲他的centos-vault倉庫裏放了之前版本的centos的包
使用方式:
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache
參考文檔:centos6 yum源不能使用
但是這麼操作,在yum makecache這句的時候還是會報錯:
http://mirrors.aliyuncs.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
解決辦法:
第一步:打開/etc/yum.repos.d/xxxxx.repo(說明:我們主要關注Centos-Base.repo,如果你已經將Centos-Base.repo替換ok了,還報上面的錯誤你就要關注epel.repo這個文件了)
第二步:執行一下ls /etc/yum.repos.d/,你會看到它下面的文件
第三步:執行vi epel.repo
第四步:將項[xxx](注意:中括號的項有好幾個,注意都要改)中的enabled=1改爲enabled=0
參考文檔:http://mirrors.aliyun.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 -