Centos7下进行python2.6和yum完全卸载及重装
1、删除现有Python
#rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##强制删除已安装程序及其关联
#whereis python |xargs rm -frv ##删除所有残余文件 ##xargs,允许你对输出执行其他某些命令
#whereis python ##验证删除,返回无结果
2、删除现有的yum
#rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
#whereis yum |xargs rm -frv
3.创建目录python和yum用以存放rpm包
#mkdir /usr/local/src/python
#mkdir /usr/local/src/yum
4.下载相应的包并进行安装
(注意:在下载相应的包的时候一定要和系统的版本号对应,可以用:
[root@localhost ~]# cat /etc/redhat-release
查看自己系统的版本号
这里我的系统版本为:Red Hat Enterprise Linux Server release 7.6 (Maipo))