卸载Python,yum
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 -fr
whereis yum
安装Python,yum
一、查看centos版本
cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
这里演示的是7.5版本的,其他版本找到对应的安装包即可
二、下载rpm包
镜像地址:http://vault.centos.org
wget http://vault.centos.org/7.5.1804/os/x86_64/Packages/python-2.7.5-68.el7.x86_64.rpm
wget http://vault.centos.org/7.5.1804/os/x86_64/Packages/python-dateutil-1.5-7.el7.noarch.rpm
wget http://vault.centos.org/7.5.1804/os/x86_64/Packages/python-devel-2.7.5-68.el7.x86_64.rpm
wget http:/<