注: 必须先卸载之前的yum跟python
删除现有的python
rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps #强制删除已安装的python以及关联
whereis python |xargs rm -frv -rf #删除所有残余的文件
whereis python #验证是否删除成功
删除现有的yum
rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps #删除yum以及关联
whereis yum |xargs rm -frv -rfm --nodeps #删除文件
到镜像站下载下面的软件包,有些包可能会升级导致下载404
python-2.7.5-76.el7.x86_64.rpm
python-backports-1.0-8.el7.x86_64.rpm
python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
python-chardet-2.2.1-1.el7_1.noarch.rpm
python-devel-2.7.5-76.el7.x86_64.rpm
python-iniparse-0.4-9.el7.noarch.rpm
python-ipaddress-1.0.16-2.el7.noarch.rpm
python-kitchen-1.1.1-5.el7.noarch.rpm
python-libsss_nss_idmap-1.16.2-13.el7.x86_64.rpm
python-pycurl-7.19.0-19.el7.x86_64.rpm
python-setuptools-0.9.8-7.el7.noarch.rpm
python-urlgrabber-3.10-9.el7.noarch.rpm
rpm-python-4.11.3-35.el7.x86_64.rpm
yum-3.4.3-167.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-aliases-1.1.31-50.el7.noarch.rpm
yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
yum-plugin-protectbase-1.1.31-50.el7.noarch.rpm
yum-updateonboot-1.1.31-50.el7.noarch.rpm
yum-utils-1.1.31-50.el7.noarch.rpm
上面rpm包我已经打包上传: https://download.csdn.net/download/qq_43673573/12701567
安装python和yum即可
rpm -Uvh --force *.rpm