how to break your debian: mix and match packages

Download this article as an e-bookDownload this article as an e-book

Let us say that you are, like me, a debian (or ubuntu) user with special needs. You have a kick-ass new laptop and you need the latest linux kernel to get all the fancy gadgets working – like your ethernet adapter.

Your computer is your work environment, so you gave up on sid / jaunty because spending a couple hours a week figuring out why apt is barfing is not an option when clients are breathing down your neck. Also, when update-manager tells you “There are 277 updates” every other day you’ll get sick of booting into the New World just to find out that the New World smells kinda funny and has no pizza. Figuratively speaking.

How to get the best of both worlds?

You want to live in a stable World but you’re still suffering from penis envy from all the shiny new things riding on jackalopes.

So you try to roll your own (make-kpkg ftw), or you frantically grab packages from other distributions and try to jam them in anyway they go…

dpkg -i --force-things --ignore-things some-weird-package.deb

It gets old really fast.
What you should be doing is apt-pinning, which is a great way to create a bastard frankenmonster of a machine.
An example. I do my work on the new debian stable (lenny). My /etc/apt/sources.list looks like this:

# SID!
deb http://ftp.no.debian.org/debian/ sid main non-free contrib
deb-src http://ftp.no.debian.org/debian/ sid main non-free contrib

# 5.0 lenny
deb http://ftp.no.debian.org/debian/ lenny main non-free contrib
deb-src http://ftp.no.debian.org/debian/ lenny main non-free contrib

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

# 6.0 squeeze
deb http://ftp.no.debian.org/debian/ squeeze main non-free contrib
deb-src http://ftp.no.debian.org/debian/ squeeze main non-free contrib

# jaunty
deb http://no.archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb-src http://no.archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse

# experimental kernels
deb http://kernel-archive.buildserver.net/debian-kernel trunk main

SWIDT? I’ve got SID, ubuntu 9.04 and experimental packages on top of my debian stable system… that’s absolutely crazy, you are right it is, but there’s one crucial thing missing: apt-pinning will make sure we don’t screw up our system with these sources. So, don’t apt-get upgrade yet,(and break your system) but instead edit /etc/apt/preferences just so:

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

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

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

Package: *
Pin: release a=jaunty
Pin-Priority: 500

500 is the default priority if you don’t have a preferences file. Here we’re saying that packages should always come from stable unless I explicitly request newer packages.

Running

apt-get update && apt-get upgrade

at this point should not cause 700MB of new packages to be downloaded, but you can use jaunty’s shiny new kernel no problem by writing

apt-get install linux-image/jaunty
which will resolve dependencies from stable. Update-manager will keep it up to date, too!

You want to install a cool package from sid, but it depends on other packages in sid? No, problem, with
apt-get install -t sid package
dependencies will be resolved in sid. Be wary though and read through the packages to be installed- updating to libc6/unstable or libc6/jaunty will probably cause breakages and might force you to install unstable versions of most of your packages… which is exactly the opposite of what we were trying to accomplish in the first place.

To check what versions for example package network-manager offers, simply write:

apt-cache policy  network-manager

network-manager:
Installed: 0.7.0.99-1
Candidate: 0.7.0.99-1
Version table:
0.7.1~rc3-0ubuntu1 0
500 http://no.archive.ubuntu.com jaunty/main Packages
*** 0.7.0.99-1 0
600 http://ftp.no.debian.org sid/main Packages
100 /var/lib/dpkg/status
0.6.6-3 0
800 http://ftp.no.debian.org lenny/main Packages
700 http://ftp.no.debian.org squeeze/main Packages

This technique also works quite well to get intrepid and jaunty packages into Ubuntu hoary 8.04 LTS, and although I’m not guaranteeing you won’t fsck up your system, you’ll be on a good road to doing so.

As a last side note I have to say that mixing and matching packages will make it real hard for you to get help from ubuntu and/or debian forum people… as the only people running such a bizarre system are likely you and me.

Download this article as an e-bookDownload this article as an e-book

Tags: , , ,

2 Responses to “how to break your debian: mix and match packages”

  1. John Connors says:

    I tried this on my machine so that I could install a shiny new mono alongside intrepid ibex. While it worked installing mono meant installing unstable/libc which I do not want to do. Back to the drawing board (I will probably have to compile mono by hand..)

    Thanks anyway.

  2. kacper says:

    Hi John,
    my howto is for a debian base system, but you could use libc and many other components from from jaunty by upping the priority of jaunty packages. This should work quite well – I gave in and am currently on libc6 2.9-4ubuntu6 from jaunty with no problems. YMMV

Leave a Reply