提前下载所需安装包,按照下面顺序安装即可完成,每个依赖包必须正确安装
下载地址:http://mirrors.163.com/centos/7/os/x86_64/Packages/
csharp
rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##强制删除已安装程序及其关联
whereis python |xargs rm -frv ##删除所有残余文件 ##xargs,允许你对输出执行其他某些命令
whereis python ##验证删除,返回无结果
rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
whereis yum |xargs rm -frv
csharp
1. rpm -ivh python-libs-2.7.5-89.el7.x86_64.rpm
2. rpm -ivh python-2.7.5-89.el7.x86_64.rpm
3. rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
4. rpm -ivh python-pycurl-7.19.0-19.el7.x86_64.rpm
5. rpm -ivh rpm-python-4.11.3-45.el7.x86_64.rpm
6. rpm -Uvh rpm-4.11.3-45.el7.x86_64.rpm rpm-build-libs-4.11.3-45.el7.x86_64.rpm rpm-libs-4.11.3-45.el7.x86_64.rpm rpm-build-4.11.3-45.el7.x86_64.rpm rpm-sign-4.11.3-45.el7.x86_64.rpm
7. rpm -ivh rpm-python-4.11.3-45.el7.x86_64.rpm
8. rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
9. rpm -ivh python-urlgrabber-3.10-10.el7.noarch.rpm
10. rpm -ivh yum-3.4.3-168.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
安装完成后python和yum就可以正常使用了