Clean up python on ubuntu

My use case is probably not unusual. I want to use Ubuntu and Google App Engine. The latest version of Ubuntu has a version of Python that is not compatible with GAE, so you need to revert to Python 2.5.5.

After that, "whereis python" detects this mess:

python: /usr/bin/python /usr/bin/python2.6 /etc/python /etc/python2.6 /usr/lib/python2.5 /usr/lib/python /usr/lib/python2.7 /usr/lib/python2.6 /usr/lib64/python2.5 /usr/lib64/python /usr/lib64/python2.7 /usr/lib64/python2.6 /usr/local/bin/python2.5 /usr/local/bin/python2.5-config /usr/local/bin/python /usr/local/lib/python2.5 /usr/local/lib/python2.6 /usr/include/python2.6 /usr/share/python /usr/share/man/man1/python.1.gz 

If it is cleaned or cleansed, will it be a risky waste of time? How will it be cleaned? Could this have been avoided? I understand that this was due to (linux) design, but can some of this intricate mess be minimized, given that I know that I always intend to have a single-user Linux system?

+4
source share
3 answers

Python is a very important utility used by apt and other packages on your system. I would try to cancel any installation you made. When you reinstall python 2.5, install using the "altinstall" mechanism so that python2.5 points to the old version:

eg:.

 # apt-get build-dep python # wget my-python-2.5.tar.bz2 # tar -xvjf ...tar.bz2 # cd Python* # ./configure --prefix=/usr # make # make altinstall 

From now on, python and python2.x still point to the standard python entering the system, while python2.5 points to python2.5 and you can use it in any of your applications (and select it by default in virtualenv .)

+3
source

Depends on how brave you are. You may have tools installed that depend on the specific version of python, otherwise they will fail. This should not cause any problems; however, the version you get will be the first on PATH. If you want 2.5.5, make sure this is the first time you use script targeting this version (if you don't like your fine as it is).

+1
source

Python2.6 is the default for the system, while / usr / bin / python points to / usr / bin / python 2.6, the system will be fine.

So, installing GAE requires 2.5.
and 2.6 for the system

What is the problem? I have 2.4, 2.5, 2.6, 2.7 and 3.1 all on my ubuntu machine

0
source

Source: https://habr.com/ru/post/1338042/


All Articles