views:

159

answers:

2

I'm wanting to use some newer software that requires Python 2.6, and we currently have both 2.4 and 2.6 installed on our dedicated CentOS server, which looks like this:

$ which python
/usr/local/bin/python
$ which python2.6
/usr/bin/python2.6
$ which python2.4
/usr/local/bin/python2.4
$ ls -l /usr/local/bin/py*
-rwxr-xr-x 1 root root      81 Aug  9  2007 /usr/local/bin/pydoc
-rwxr-xr-x 2 root root 3394082 Aug  9  2007 /usr/local/bin/python
-rwxr-xr-x 2 root root 3394082 Aug  9  2007 /usr/local/bin/python2.4

How can I switch it to start using 2.6 as the default python?

Thank You!

+2  A: 

As root:

ln -f /usr/bin/python2.6 /usr/local/bin/python

This will make a hardlink from /usr/local/bin/python --> /usr/bin/python2.6 (replacing the old hardlink).

unutbu
according to the question 2.6 is in /usr/bin
DiggyF
@SiggyF: Oops, yes. Thanks!
unutbu
A: 

rm /usr/local/bin/python
ln -s /usr/local/bin/python2.6 /usr/local/bin/python

recoisiche