Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer

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

share|improve this answer
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. – Dennis Williamson 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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