Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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:
                            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.

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
1  

Your Answer

 
discard

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.