简体   繁体   English

在没有 yum 的情况下卸载 python 2.6

[英]Uninstall python 2.6 without yum

I accidentally downloaded python2.6.6 on my centos Virtual Machine from python.org's official download package and compiled it to source.我不小心在我的centos虚拟机上从python.org的官方下载包下载了python2.6.6,编译成源码。

Now in my /usr/local/bin I have a python2.6 shell available and now if I use which python it will give me the path of /usr/local/bin instead of original python2.7's path which is /usr/bin.现在在我的 /usr/local/bin 我有一个 python2.6 shell 可用,现在如果我使用which python它会给我 /usr/local/bin 的路径而不是原始的 python2.7 的路径 /usr/bin .

Since I installed it from source, yum doesn't recognise python2.6.6 as a package and I want to get rid of it.由于我是从源代码安装的,yum 无法将 python2.6.6 识别为包,我想摆脱它。

If I do rpm -q python it gives me a result of python-2.7.5-48.0.1.el7.x86_64如果我执行rpm -q python它会给我 python-2.7.5-48.0.1.el7.x86_64 的结果

Is it possible to uninstall python2.6.6 and I will just re-point my python system variable to /usr/bin again?是否可以卸载python2.6.6,我将再次将我的python系统变量重新指向/usr/bin?

Sure, but you'll have to do it the hard way.当然可以,但你必须以艰难的方式去做。 Dig through /usr/local looking for anything Python-related and remove it./usr/local查找任何与 Python 相关的内容并将其删除。 The python in /usr/bin should be revealed once the one in /usr/local/bin is removed.删除/usr/local/binpython ,应显示/usr/binpython

Also, next time make altinstall .另外,下次make altinstall It will install a versioned executable that won't get in the way of the native executable.它将安装一个版本化的可执行文件,不会妨碍本机可执行文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM