linux 下卸载 Python3

一、卸载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的目录全部删除

原文地址:https://www.cnblogs.com/bxhsdy/p/13298621.html