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.

After some digging and experimentation, I figured out how to install Python 2.6 on Debian 5.0 using apt-get. So I thought it best to post on SF as a question and answer. I know this can be manually built and installed, but many people prefer to use apt-get (including myself).

share|improve this question

3 Answers 3

up vote 5 down vote accepted

This is a good way to break your system; you'll wind up upgrading all sorts of stable things to unstable, and you'll have trouble from then on, because Debian isn't designed to run on a system that's halfway stable and halfway unstable.

A better way is a backport, but it's not straightforward to backport 2.6 to lenny apparently.

share|improve this answer
    
My answer thoroughly broke my system -- dependency mismatch ahoy! I will try pinning next time. –  nbolton Jun 30 '10 at 22:44

Use Apt-Pinning.

I'm not yet very used to this concept, but it seems to basically means that you configure your Debian system in a way such that you can install packages from stable, testing, untested (and potentially other repositories such as backports) directly using apt-get, without breaking (too much) the dependencies of the system, because by default it will use stable, and only when you want it it will search in the other repositories.

This is a very nice, ergonomic and safe way to update only some parts of a Debian system to the latest releases, without breaking the dependencies and the global stability of the system.

A nice tutorial about Apt-Pinning: http://jaqque.sbih.org/kplug/apt-pinning.html

I am using Lenny with Plesk on a dedicated virtual host, here's my config files, made on 2012-01-11:

apt.conf

APT::Cache-Limit "16777216";

sources.list

#Stable
deb http://ftp.de.debian.org/debian lenny main contrib non-free
deb http://ftp.de.debian.org/debian-volatile lenny/volatile main contrib non-free
deb http://ftp.de.debian.org/debian-security lenny/updates main contrib non-free

#Proposed updates
deb http://ftp.de.debian.org/debian lenny-proposed-updates main contrib non-free
deb http://ftp.de.debian.org/debian-volatile lenny-proposed-updates/volatile main contrib non-free

#Testing
deb http://ftp.de.debian.org/debian testing main contrib non-free

#Unstable
deb http://ftp.de.debian.org/debian unstable main contrib non-free

#Backports
deb http://ftp.de.debian.org/debian-backports lenny-backports main contrib non-free

#Plesk (? what does it do? install additional modules from the webinterface?)
#Uncomment the next line only if you have Plesk installed.
#deb http://autoinstall.plesk.com/debian/PSA10 lenny all

preferences

Package: *
Pin: release a=stable
Pin-Priority: 700

Package: *
Pin: release a=lenny-proposed-updates
Pin-Priority: 650

Package: *
Pin: release a=testing
Pin-Priority: 600

Package: *
Pin: release a=unstable
Pin-Priority: 550

Package: *
Pin: release a=lenny-backports
Pin-Priority: 500

These files are all to be placed under the directory /etc/apt/

Then, you can just use apt-get python, and it will directly install python 2.7 on your system with all the dependencies! And if you want to install newer versions (such as 3.x), you can try the advices given in the page I've linked to force looking into other repositories:

apt-get install <package>/unstable
#This will install the unstable version of the package, and try to meet any dependencies from Stable.

or

apt-get -t unstable install <package>
#This will install the Unstable version of the package, and try to meet any dependencies from Unstable.
share|improve this answer

Update: Removed answer, since it involves some abuse of aptitude. The best way is actually to install 2.6 using sources (though this is a bit harder, it's less likely to screw your system up).

share|improve this answer
2  
Unstable will always be sid, not just currently. If you are going to include testing packages, you might also want to setup pinning (jaqque.sbih.org/kplug/apt-pinning.html), so you only get the packages from unstable that you really need. –  Zoredache Feb 9 '10 at 23:59
    
Since this answer perfectly describe how to break your system and if one doesn't thoroughly reads the other answer and commits, it's –  mark Oct 23 '10 at 12:26

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.