chiggsy Asked: 2009-09-12 10:45:47 +0800 CST2009-09-12 10:45:47 +0800 CST 2009-09-12 10:45:47 +0800 CST debian python2.6 as default? 772 is it possible to set the default python to 2.6 for debian lenny somehow? debian 2 Answers Voted Dennis Williamson 2009-09-12T11:29:38+08:002009-09-12T11:29:38+08:00 If alternatives are already set up: update-alternatives --config python then choose from the list that's presented. If they're not set up, then do this: If there is a symlink already set up, save it: sudo mv /usr/bin/python /usr/bin/pythonSAVE create the alternatives sudo update-alternatives --install python2.6 python /usr/bin/python2.6 2 sudo update-alternatives --install python2.5 python /usr/bin/python2.5 1 create a new symlink sudo ln -s /etc/alternatives/python /usr/bin/python choose the one you want to use sudo update-alternatives --config python Best Answer Laurent Giroud 2010-07-10T06:44:37+08:002010-07-10T06:44:37+08:00 I'd just like to comment on Dennis Williamson's answer: Using the command line provided for the "install" commands results in this error: update-alternatives: error: alternative link is not absolute as it should be: python2.5 it looks like the syntax to create the alternative would rather be: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 1 Ie, the first parameter needs to be an absolute path, not just a name.
If alternatives are already set up:
then choose from the list that's presented.
If they're not set up, then do this:
If there is a symlink already set up, save it:
sudo mv /usr/bin/python /usr/bin/pythonSAVE
create the alternatives
sudo update-alternatives --install python2.6 python /usr/bin/python2.6 2
sudo update-alternatives --install python2.5 python /usr/bin/python2.5 1
create a new symlink
sudo ln -s /etc/alternatives/python /usr/bin/python
choose the one you want to use
sudo update-alternatives --config python
I'd just like to comment on Dennis Williamson's answer:
Using the command line provided for the "install" commands results in this error:
it looks like the syntax to create the alternative would rather be:
Ie, the first parameter needs to be an absolute path, not just a name.