May 08 2006
12:21 GMT
Using Sarge with backports and other sources (even sid) debian 

Using Debian Sarge (stable) with "testing" and "unstable" is not always the best idea, as in order to get a package not present in Sarge you might need to make a massive update of libs, thus having a mixed system, not quite Sarge anymore.

However, you can use at times some packages from the "testing" and "unstable" — just don't forget to check first the backports repositories!

A newer package backported to Sarge is supposed to be compiled on a Sarge system, with as little as possible "foreign dependencies" (in theory), so you would not have to perform a massive upgrade (nor a dist-upgrade) to be able to use it!

Backported packages for Sarge exist in plenty of places, and a place where you can look for them is www.apt-get.org. For not messing things up, it's advisable to generally stick to a fixed list of sources.

Here's a selection of Sarge extra repositories, and what to expect from them:

 deb http://www.backports.org/debian/ sarge-backports main contrib non-free
Plenty of backports, e.g.: openoffice 2.0.1, amule 2.1.0, amsn 0.9.5, blam 1.8.2, clamav 0.88.1, dvd+rw-tools_6.1, Firefox 1.5.0.3, fluxbox_0.9.14, fuse 2.5.2, fvwm 2.5.16, gaim 1.5.1, gecko-sharp2 0.11, gimp 2.2.11, gstreamer 0.10, gtk_sharp2 2.4.0, hibernate 1.12, inkscape 0.43, iptables 1.3.3, ipython 0.7.1, KDE 3.5.0, koffice 1.4.2, liferea 1.0.7, lighttpd 1.4.11, (linux-2.6): kernel 2.6.16 (image 686, headers), lua 5.1, Mono 1.1.12, MonoDevelop 0.9, MySQL 5.0.20, nVU 1.0, PHP 5.1.2, postfix 2.2.10, postresql 8.1.3 and 8.0.7, sylpheed_2.0.4, Thunderbird 1.5.3, TinyERP 3.2.1, vim 6.4, wget 1.10.2, wine 0.9.7, wireless-tools_27+28pre13, wxwidgets 2.6.1, xen-tools 1.2, XFCE 4.2.2, xorg-x11_6.9.0, Zope 2.8.6
 deb http://ftp.debian-unofficial.org/debian/ sarge main contrib non-free restricted
bladeenc, beep-media-player-wma, lame, libdvdcss2, gvidcap, sun java, adobe reader, opera 9, pine
 deb http://mirror.zic-network.ch/dotdeb/ sarge all
DotDeb.org includes mainly PHP 4 & 5, MySQL 4.1 & 5, and a few others.
 deb http://debian.stdout.at/ ./
Mozilla Firefox and Mozilla Thunderbird
 deb ftp://ftp.nerim.net/debian-marillat/ sarge main
The classical repo for restricted formats multimedia and alike.
 deb http://debian.jones.dk/ sarge misc
misc packages
 deb http://deb.stosberg.net/ sarge main
 deb-src http://deb.stosberg.net/ sarge main
misc packages, incl. KDE 3.5.1, udev 0.7, amaroK, etc.
 deb http://debian.buzzzed.de/ sarge main non-free contrib
 deb-src http://debian.buzzzed.de/ sarge main non-free contrib
misc packages

How do I use them? In order to set a repository as prioritary over another repository, I have to set proper pin priorities to the enabled ones. My current configuration files look as follows:

My /etc/apt/apt.conf (not mandatory) —OR— /etc/apt/apt.conf.d/10debconf (not mandatory):
APT::Default-Release "none";
NOTE: If I want to force the preference of the packages in Sarge (e.g. Firefox 1.0.4) over other sources, I can set them a priority of 990 with:
APT::Default-Release "stable";

My /etc/apt/sources.list:
# deb file:///cdrom/ sarge main
#stable
deb ftp://ftp.belnet.be/debian/ stable main non-free contrib
deb-src ftp://ftp.belnet.be/debian/ stable main non-free contrib
#testing, will disable by pin
deb ftp://ftp.belnet.be/debian/ testing main non-free contrib
deb-src ftp://ftp.belnet.be/debian/ testing main non-free contrib
#unstable, will disable by pin
deb ftp://ftp.belnet.be/debian/ unstable main non-free contrib
deb-src ftp://ftp.belnet.be/debian/ unstable main non-free contrib
#stable/updates
deb http://security.debian.org/ stable/updates main non-free contrib
#multimedia, backports, etc.
deb ftp://ftp.nerim.net/debian-marillat/ sarge main
deb http://debian.jones.dk/ sarge misc
deb http://ftp.debian-unofficial.org/debian/ sarge main contrib non-free restricted
deb http://mirror.zic-network.ch/dotdeb/ sarge all
deb http://www.backports.org/debian/ sarge-backports main contrib non-free
deb http://debian.buzzzed.de/ sarge main non-free contrib
deb-src http://debian.buzzzed.de/ sarge main non-free contrib
deb http://deb.stosberg.net/ sarge main
deb-src http://deb.stosberg.net/ sarge main
deb http://debian.stdout.at/ ./

My current /etc/apt/preferences:
Package: *
Pin: release o=Debian, a=stable
Pin-Priority: 500

Package: *
Pin: release o=Debian, a=testing
Pin-Priority: 200

Package: *
Pin: release o=Debian, a=unstable
Pin-Priority: 200

Package: *
Pin: origin "ftp.nerim.net"
Pin-Priority: 600

Package: *
Pin: origin "debian.jones.dk"
Pin-Priority: 600

Package: *
Pin: origin "ftp.debian-unofficial.org"
Pin-Priority: 600

Package: *
Pin: origin "mirror.zic-network.ch"
Pin-Priority: 600

Package: *
Pin: origin "ftp.de.debian.org"
Pin-Priority: 600

Package: *
Pin: origin "debian.buzzzed.de"
Pin-Priority: 600

Package: *
Pin: origin "deb.stosberg.net"
Pin-Priority: 600

Package: *
Pin: origin "debian.stdout.at"
Pin-Priority: 600

Package: udev
Pin: release a=stable, o=Debian
Pin-Priority: 1001

Package: kernel-*
Pin: release a=stable, o=Debian
Pin-Priority: 1001

Package: xfree86-*
Pin: release a=stable, o=Debian
Pin-Priority: 1001

Package: xorg-x11*
Pin: release a=stable, o=Debian
Pin-Priority: 1001
Note that:
  • Debian "testing" and "unstable" are "partially disabled": 200 is less than the default priority level (500), so they're not considered to be part of the current release (which is true). However, they will get used for install if a newer version of an installed package could not be found in any other sources! To prevent considering automatically these sources, set Pin-Priority to a value less than the priority of an installed package (100), say 95. In this case, a package from these sources will get installed only if there is no version installed and no other source has a package that can be found here. To completely prevent any installation from them, set a negative priority. If you fully enable them, you might consider giving "testing" a better priority than to "unstable" e.g. 700 vs. 650.

  • All the extra repositories having a Pin-Priority of 600 are fully enabled (>500). However, if you want to set them as prioritary over the current release (which has 990 if set with APT::Default-Release "stable"; or 500 as listed in this file), let them have a priority like 995 or 999.

  • Packages udev, kernel-* (whatever), XFree86 and X.Org are prevented from any upgrade by having a priority over the downgrade limit (1000). You will have to unprotect them manually. You might want to protect other sensitive packages, like libc6, etc.
Do not confuse "o=" (Origin) with "origin some.url.here". Better off, if there is something you don't understand, read some documentation:

Official manuals:Debian Wikis:Good articles:Man pages:
How to work with repositories — quick check-list:
  • After adding or enabling a source, do: apt-get update

  • Simple way: apt-get install package_name

  • Simple way, force a version: apt-get install package_name=version

  • Install from a preferred (forced) source, e.g.:
    apt-get install package_name/sarge-backports.
    This will NOT try to meet any dependencies from the same forced source! (May not work.)

  • Install from a preferred (forced) source, also meeting any other dependency from the forced source. E.g.:
    apt-get -t sarge-backports install package_name.

  • Examine the policy in effect to see what version will get installed and why (also useful for debugging unmet dependencies):
    apt-cache policy package_name

  • Obviously enough, with aptitude or Synaptic you'll have easier choices to select or force a version, and to fix unmet dependencies.

How to fix the annoying error "E: Dynamic MMap ran out of room" while performing an apt-get update or starting Synaptic, aptitude, or dselect?

Put a very large value in /etc/apt/apt.conf —OR— in /etc/apt/apt.conf.d/10debconf:
APT::Cache-Limit "30000000";
Usually, a value of 10 million to 20 million should work. With a lot of repositories (like in my case), 30 million is much safer.

Sample case of dealing in Sarge with different versions from different sources, with different dependencies (some of them unmet or too heavy) — for what else other than... Mozilla Firefox?


Wow, I was prepared to show some version mangling here, but I can't do it anymore. I updated libc6 from 2.3.2 to 2.3.6, which implied some other replacements (even gdm!), so the situation is more even now.

If we set "stable" (Sarge) as the default release (APT::Default-Release "stable";), the candidate to be installed would be... Firefox 1.0.4:
# apt-cache policy firefox
mozilla-firefox:
  Installed: (none)
  Candidate: 1.0.4-2sarge6
  Version Table:
     1.5.dfsg+1.5.0.3-2 0
     200 ftp://ftp.belnet.be testing/main Packages
     200 ftp://ftp.belnet.be unstable/main Packages
     1.5.dfsg+1.5.0.3-1bpo1 0
     500 http://www.backports.org sarge-backports/main Packages
     1.5.dfsg+1.5.0.1-3.he-1 0
     500 http://debian.stdout.at ./ Packages
     1.0.4-2sarge6 0
     990 http://security.debian.org stable/updates/main Packages
     1.0.4-2sarge4 0
     990 ftp://ftp.belnet.be stable/main Packages
That's what I don't want, that's why I disabled the setting of a default release:
# apt-cache policy firefox
mozilla-firefox:
  Installed: (none)
  Candidate: 1.5.dfsg+1.5.0.3-1bpo1
  Version Table:
     1.5.dfsg+1.5.0.3-2 0
     200 ftp://ftp.belnet.be testing/main Packages
     200 ftp://ftp.belnet.be unstable/main Packages
     1.5.dfsg+1.5.0.3-1bpo1 0
     500 http://www.backports.org sarge-backports/main Packages
     1.5.dfsg+1.5.0.1-3.he-1 0
     500 http://debian.stdout.at ./ Packages
     1.0.4-2sarge6 0
     500 http://security.debian.org stable/updates/main Packages
     1.0.4-2sarge4 0
     500 ftp://ftp.belnet.be stable/main Packages
Let's see now, using the -s (simulate) flag, "what if" we'd like to install a particular version of Mozilla Firefox.

1.5.0.1 is straightforward (the same is 1.5.0.3 from sarge-backports, which I installed later):
# apt-get -s install firefox=1.5.dfsg+1.5.0.1-3.he-1
Reading Package Lists... Done
Building Dependency Tree... Done
Suggested packages:
  firefox-gnome-support latex-xft-fonts xprint
The following NEW packages will be installed:
  firefox
0 upgraded, 1 newly installed, 0 to remove and 334 not upgraded.
Inst firefox (1.5.dfsg+1.5.0.1-3.he-1 debian.stdout.at)
Conf firefox (1.5.dfsg+1.5.0.1-3.he-1 debian.stdout.at)
1.5.0.3 from unstable would be impossible to install on Sarge, due to unmet dependencies (with current settings):
# apt-get -s -t unstable install firefox
...
The following packages have unmet dependencies:
  firefox: Depends: libgtk2.0-0 (>= 2.8.0) but 2.6.4-3.1 is to be installed
     Depends: libxfixes3 but it is not going to be installed
     Depends: libxinerama1 but it is not going to be installed
E: Broken packages
As for installing the same version from testing, it would be a complete mess!
# apt-get -s -t testing install firefox
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  gcc-4.1-base libatk1.0-0 libgcc1 libglib2.0-0 libgtk2.0-0 libgtk2.0-bin
  libgtk2.0-common libpango1.0-0 libpango1.0-common libstdc++6 libxfixes3
  libxinerama1 libxrender1
Suggested packages:
  firefox-gnome-support latex-xft-fonts xprint ttf-kochi-gothic
  ttf-kochi-mincho ttf-thryomanes ttf-baekmuk ttf-arphic-gbsn00lp
  ttf-arphic-bsmi00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp
Recommended packages:
  libatk1.0-data libglib2.0-data x-ttcidfont-conf
The following NEW packages will be installed:
  gcc-4.1-base libstdc++6 libxfixes3 libxinerama1
The following packages will be upgraded:
  firefox libatk1.0-0 libgcc1 libglib2.0-0 libgtk2.0-0 libgtk2.0-bin
  libgtk2.0-common libpango1.0-0 libpango1.0-common libxrender1
10 upgraded, 4 newly installed, 0 to remove and 875 not upgraded.
Inst gcc-4.1-base (4.1.0-1+b1 Debian:testing)
Inst libgcc1 [1:3.4.3-13] (1:4.1.0-1+b1 Debian:testing)
Conf gcc-4.1-base (4.1.0-1+b1 Debian:testing)
Conf libgcc1 (1:4.1.0-1+b1 Debian:testing)
Inst libstdc++6 (4.1.0-1+b1 Debian:testing)
Inst libxrender1 [0.8.3-7] (1:0.9.0.2-1 Debian:testing)
Inst libpango1.0-common [1.8.1-1] (1.12.1-2 Debian:testing) []
Inst libpango1.0-0 [1.8.1-1] (1.12.1-2 Debian:testing) []
Inst libglib2.0-0 [2.6.4-1] (2.10.2-1 Debian:testing)
Inst libatk1.0-0 [1.8.0-4] (1.11.3-1 Debian:testing)
Inst libgtk2.0-common [2.6.4-3.1] (2.8.16-1 Debian:testing)
Inst libxinerama1 (6.9.0.dfsg.1-6 Debian:testing)
Inst libgtk2.0-bin [2.6.4-3.1] (2.8.16-1 Debian:testing) []
Inst libgtk2.0-0 [2.6.4-3.1] (2.8.16-1 Debian:testing)
Inst libxfixes3 (6.9.0.dfsg.1-6 Debian:testing)
Inst firefox [1.5.dfsg+1.5.0.3-1bpo1] (1.5.dfsg+1.5.0.3-2 Debian:testing)
Conf libstdc++6 (4.1.0-1+b1 Debian:testing)
Conf libxrender1 (1:0.9.0.2-1 Debian:testing)
Conf libglib2.0-0 (2.10.2-1 Debian:testing)
Conf libpango1.0-0 (1.12.1-2 Debian:testing)
Conf libpango1.0-common (1.12.1-2 Debian:testing)
Conf libatk1.0-0 (1.11.3-1 Debian:testing)
Conf libxinerama1 (6.9.0.dfsg.1-6 Debian:testing)
Conf libgtk2.0-bin (2.8.16-1 Debian:testing)
Conf libgtk2.0-0 (2.8.16-1 Debian:testing)
Conf libgtk2.0-common (2.8.16-1 Debian:testing)
Conf libxfixes3 (6.9.0.dfsg.1-6 Debian:testing)
Conf firefox (1.5.dfsg+1.5.0.3-2 Debian:testing)
We definitely don't want that...

But with current settings in my Sarge, "apt-get install firefox" just worked (1.5.0.3), the same for "apt-get install openoffice2" (2.0.1), etc.

A last hint: if you don't know the name of the package (or metapackage) to install, your friends are:
  • apt-cache search package_name
  • aptitude
  • Synaptic
All of them as root or prefixed with sudo, of course.

updated accuracy

For Marillat's repo, see: New home for Marillat's multimedia repository and Tiny annoyance with Marillat's repo.

2 (+0) comments so far      [view/add comments]       [permalink]