[NCLUG] apt-get questions

Michael Milligan milli at acmeps.com
Thu Jan 16 14:26:57 MST 2003


Marcio Luis Teixeira wrote:
> Thanks everyone. It looks like Debian "testing" is where I really want to be,
> at least for the non-critical stuff. I'm assuming that if I take care of 
> dependencies, I can mix and match packages between the three releases, 
> correct? (so I can shoot myself in the foot as much or as little as I wish :)

You can do this but you need a little bit of magic to make that work. 
It actually doesn't make a lot of sense to be on the stable release at 
all if you want recent versions of packages, so yes, you need to at 
least be on testing (a.k.a. "sarge", until it is blessed as the stable 
release).  The stable release will only get you security fixes.  If you 
want really bleeding edge stuff, you can go with unstable (a.k.a. "sid", 
and will always be sid).  FWIW, I've found that the Debian testing 
release has always been more stable than a RedHat official release, at 
least since RedHat 6.2 anyway.  I run the testing release mixed with 
some unstable packages on production boxes, and unstable on everything 
else.  ;-)

To mix and match between testing and unstable you need to tell apt to 
"Pin" packages from these different releases at different priorities. 
You can think of this as layers, like in PhotoShop.  E.g., you can 
specify "testing" as your main release stream (the top, most visible 
layer), and specify sid (unstable) at a lower priority (the bottom 
layer).  Any package with the same name in both releases will default to 
the version in testing.  Any packages in unstable that do not have a 
corresponding package in testing (i.e., new, bleeding edge stuff) will 
"show through".  The best of both worlds.  (Fair warning though... this 
can get a little challenging when it comes to resolving dependencies.)

To do this, create a file, /etc/apt/preferences, and in it:

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

Just those three lines.  This says to prefer packages in unstable at a 
(lower) priority of 50.  Anything else will get the default priority of 
500.  Higher is more preferable.

Next, you need to add lines to your /etc/apt/sources.list to retrieve 
the lists of packages in the two different releases.  Here's an example 
/etc/apt/sources.list:

deb http://mirror.direct.ca/linux/debian/ sid main contrib non-free
deb http://mirror.direct.ca/linux/debian/ sarge main contrib non-free
deb http://non-us.debian.org/debian-non-US sid/non-US main contrib non-free
deb http://non-us.debian.org/debian-non-US sarge/non-US main contrib 
non-free
deb-src http://non-us.debian.org/debian-non-US/ sid/non-US main contrib 
non-free
deb-src http://non-us.debian.org/debian-non-US/ sarge/non-US main 
contrib non-free

You'll notice it specifies both "sid" and "sarge" releases.

Execute an "apt-get update" and you should be set.

> I've just found out that testing (and unstable), have way more recent versions 
> of synaptic (stable: 0.16-6, testing: 0.25-2, unstable: 0.31-3), so bumping 
> up to "testing" or "unstable" may well give me the features I've been looking 
> for in the installer.

FYI, I use "aptitude" for package management.  Works tons better than 
dselect, and it's ncurses-based so I can upgrade systems remotely in a 
terminal window.  It's also nice in that you can see both "layers", 
i.e., the version number of a package in testing and in unstable with 
the "v" key and select the one in unstable if you want.  It will 
otherwise pick the one based on it's Pin, which would be from testing if 
you've set /etc/apt/preferences as above.

Have fun!

Regards,
Mike

-- 
Michael Milligan  --  Free Agent  --  milli at acmeps.com




More information about the NCLUG mailing list