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


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:

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:

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

  • Why wouldn't the alternatives be setup?
    – womble
    Sep 12 '09 at 5:56
  • I don't know. On my system, even though other programs were already set up, python wasn't despite the fact that I've got 2.5, 2.6 and 3.0 installed. Sep 12 '09 at 7:38
  • I can say now that aptitude checks to ensure that python is a symlink to /usr/bin/python2.6. This bypasses the alternatives system. Perhaps that need for debian_default python, plus the availability virtualenv and buildout, are why python is not configured with alternatives.
    – chiggsy
    Oct 18 '10 at 6:30
  • 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.