一、卸載Python3
1、卸載python3
rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps
2、 刪除所有殘余文件
whereis python3 |xargs rm -frv
3、查看現有安裝的python
whereis python
[root@sh-idc-dba-test1 ~]# whereis python python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/local/python37/bin/python3.7 /usr/local/python37/bin/python3.7m /usr/local/python37/bin/python3.7m-config /usr/local/python37/bin/python3.7-config /usr/share/man/man1/python.1.gz [root@sh-idc-dba-test1 ~]# [root@sh-idc-dba-test1 ~]# [root@sh-idc-dba-test1 ~]# whereis python3 |xargs rm -frv removed ‘/usr/local/python37/bin/python3.7’ removed ‘/usr/local/python37/bin/python3.7m’ removed ‘/usr/local/python37/bin/python3’ removed ‘/usr/local/python37/bin/python3.7m-config’ removed ‘/usr/local/python37/bin/python3.7-config’ [root@sh-idc-dba-test1 ~]# [root@sh-idc-dba-test1 ~]# [root@sh-idc-dba-test1 ~]# whereis python python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz [root@sh-idc-dba-test1 ~]#
然后使用find 命令找出 python的目錄全部刪除