[UFO Chicago] new features in woody's APT

Sean Neakums sneakums@ufo.chicago.il.us
Mon, 31 Dec 2001 21:37:24 +0000


The version of APT to be included in the upcoming Debian 3.0 has a
number of new features, the most important of which is the `apt-get
moo' command.  You should run it immediately if you have not already
done so.  Go ahead; what follows can wait.

The other feature of woody's APT that I would like to discuss is the
/etc/apt/preferences file.  It's used to `pin' packages at certain
versions, or to even prevent certain kinds of packages from being
installed.  Since I live at the end of a modem, I like to not have to
upgrade large packages such as Mozilla and Emacs too often.  (In the
case of Emacs, I build a slightly modified version anyway.)

So, let's assume that you have version 0.9.7-1 of Mozilla and its
associated libraries installed, and that 0.9.7-2 is waiting to be
downloaded at your Debian mirror.  However, this new version of
Mozilla makes up ten megs of a sixteen meg shaboom[0].  You don't
really feel like downloading it today.  So, you open up
/etc/apt/preferences in your favourite editor and type (without the
preceding whitespace):

  Package: mozilla-browser
  Pin: release v=0.9.7-1

Closing the file and issuing apt-get dist-upgrade presents you with
the news that mozilla-browser is to be REMOVED!  This isn't what you
want at all.  So why is it happening?

The problem is the libnspr4 library, upon which mozilla-browser
depends.  Check out what the Depends: field says:

          libnspr4 (= 2:0.9.7-1)

mozilla-browser requires *exactly* that version of libnspr4; it will
not install with any other version.  And since a higher version of
libnspr4 is available, apt elects to install it and resolve the
resulting dependency problem by removing mozilla-browser.  Clearly you
need to keep that version of libnspr4 installed too, so you open up
/etc/apt/preferences again and add:

  Package: libnspr4
  Pin: release v=0.9.7-1

You shaboom, and everything with an available upgrade except
mozilla-browser and libnspr4 is downloaded and installed.  Beaujolais!

N.B.: If you use mozilla-psm, you'll need to add similar entries for
that package and libnss3.

You can read all about /etc/apt/preferences in apt_preferences(5).

Cheers,

	Sean.


[0] Shaboom: as a verb, to perform `apt-get update' followed by
    `apt-get dist-upgrade'.  As a noun, the act of shabooming, or the
    set of packages that need to be downloaded as part of a shaboom
    operation.  A `deficit shaboom' is one in which the total size of
    the Packages files downloaded for the update exceeds the total
    size of the packages to be upgraded.

-- 
Sean Neakums - <sneakums@ufo.chicago.il.us> --- --- -- -
Director of International Operations, UFO Chicago - -- -
http://ufo.chicago.il.us/ --- ------ ----- ---- --- -- -