debian python2.6 as default?

is it possible to set the default python to 2.6 for debian lenny somehow?


Solution 1:

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.

Solution 2:

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