One - One Code All

Blog Content

腾讯云卸载重装python3

Python Linux-Mac   2021-09-19 09:34:27

腾讯云服务器重装python3.

系统:TencentOS Server


重置本机ECDSA host key:ssh-keygen -R "IP address"


查看python3

# whereis python3
python3: /usr/bin/python3.8 /usr/bin/python3.6 /usr/bin/python3 /usr/bin/python3.6m 
/usr/lib/python3.8 /usr/lib/python3.6 /usr/lib64/python3.8 /usr/lib64/python3.6 
/usr/local/lib/python3.6 /usr/include/python3.8 /usr/include/python3.6m /usr/share/man/man1/python3.1.gz

查看/usr/bin/yum文件并备份

# cat /usr/bin/yum
#!/usr/libexec/platform-python
# The dnf executable script.

卸载python3

rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps
whereis python3 |xargs rm -frv
whereis  python

这个方法会清掉 /usr/bin/yum,   由于yum里引用了python包里的dnf,所以,比较蛋疼,最后导致yum 和dnf 不能用了。


上一篇:修改sublime text 3 build with python路径

The minute you think of giving up, think of the reason why you held on so long.