系统版本: Centos 6.10 64位
采用rpm方式安装yum源,首先需要下载yum几个文件如下:
网上给的下载方式都已经不能下载了,全都404报错异常,不过在我多次尝试多个网站之后,最终在搜狐找到了,网址如下:
直接在linux上面执行wget方式下载:
wget http://mirrors.sohu.com/centos/6.10/os/x86_64/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.sohu.com/centos/6.10/os/x86_64/yum-3.2.29-81.el6.centos.noarch.rpm
wget http://mirrors.sohu.com/centos/6.10/os/x86_64/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.sohu.com/centos/6.10/os/x86_64/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
下载完成之后,依次执行:
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm --force --nodeps
安装完成之后,然后就执行:
yum clean all
yum makecache
然后就会报错:
http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - “couldn’t connect to host”
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrors.cloud.aliyuncs.com’”
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
这个原因就是最上面图片讲述的,因为Centos6官方宣布进入结束时代,意思是让你用7,7挺不错的,我们生产上面就是7
解决方法有两种:
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
上面操作就是改一下yum源的下载位置,因为之前的Centos6相关的在2020年底换位置了
然后执行yum list,打印出来一堆yum源相关信息,到这恭喜,安装完成
总结:
还是用Centos7吧,人家官方都不打算更新Centos6了,而且很多生产都是Centos7,足以证明Centos7的稳定性,7就没这么多事了,官方一直在维护更新中.最终再次感谢链接大佬提供的解决方案,谢谢.