Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default version of python in a linux machine ?(not just symlink) [closed]

I have multiple versions of python installed in ubuntu (precise) for various reasons and uses. I have python 2.7 and python 2.6. I need to make python 2.6 the default and not python 2.7. I updated python symlink to point to python2.6. That will only give me commandline access straight to python2.6. but when I install some package from aptitude, it goes straight to python2.7 compatible stuff because somewhere in the OS, its sees that as the default. How should I change this ?

P.S : I know the workaround of installing from package's source code. But its not easy to get the source code always and not all are generous.

like image 981
King Avatar asked Aug 01 '12 09:08

King


1 Answers

On Ubuntu and other Debian-derived distributions, the proper way to define which Python version to run system-wide is with sudo update-alternatives --config python. See also http://www.stylesen.org/python_27_debian_squeeze_60

like image 91
tripleee Avatar answered Nov 13 '22 20:11

tripleee