How to uninstall Python2.6

冷暖自知 提交于 2019-11-30 20:13:31

Uninstalling the system Python is a bad idea. There are many other packages and softwares that depend on it. It'll be better that you use python2.7 by either modifying the $PATH or creating an alias e.g. python2.7 that points to the python that you installed in /opt dir.

Uninstalling fedora-provided python 2.6 might break many packages that depend on it. I advise you against doing it.

Now, your problem is simply that $PATH and similar variables ($MAN_PATH etc.) are searched from left to right. You appended your new /opt/python27/bin after standard locations like /usr/bin. Reverse the order, and you will get /opt/python27/bin/python as a default python binary.

First of all - never ever try to uninstall Python on RHEL/CentOS/Fedora. yum is written in Python and there will be many problems with repairing the system.

If you want the system to use Python2.7 by default, find where the Python2.6 (use whereis python or which python commands) binary is located, backup it and replace with the binary of Python2.7

user3535208

Instead of uninstall older version, use specific version of python while using it

I changed symbolic link

ln -s /usr/local/bin/python2.7 /usr/local/bin/python

And used

python -m pip install pip --upgrade
Deepak Pawaskar

Or you can simply use Yum feature of linux & run command yum remove python it will delete python & related dependencies from the system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!