[vox-tech] Debian Unstable - apt strangeness

Rick Moen rick at linuxmafia.com
Fri Aug 13 15:29:45 PDT 2004


Quoting Peter Jay Salzman (p at dirac.org):

> Apt and dpkg seem to have differing views about what packages are
> available.

As they should.  They do entirely different things -- and work together
as a stack (apt invoking dpkg; dpkg being lower in the stack).

apt (meaning apt-get, apt-cdrom, apt-zip):  Fetches packages from sundry 
package sources, resolves dependencies, manages the available-packages
information.

dpkg:  removes packages, installs fetched packages (that have been
dropped off into /var/cache/apt/archive), initiates "--configure" step
for some packages immediately following their installation.

> For example:
> 
> Dpkg doesn't believe this package exists:
> 
>    lucifer# dpkg -l libgimp2.0
>    No packages found matching libgimp2.0.

I think you're misinterpreting:  dpkg is merely saying that no package
matching that ASCII pattern is _installed_.  dpkg knows nothing about 
available packages (as indicated in /var/lib/apt/lists/*Packages and
/var/lib/dpkg/available).  It knows only about the contents of
/var/lib/dpkg/status -- the "installed packages" database.


> In fact, dpkg is pretty much clueless about gimp in general:
> 
>    lucifer# dpkg -l "*gimp*"
>    ||/ Name           Version        Description
>    +++-==============-==============-==========================
>    un  gimp1.3        <none>         (no description available)

I'm pretty sure that "un" means "Desired=Unknown, Status=Not installed"
(i.e., that the u and the n are separate key values with those meanings).
But I could be wrong.

> Yet apt-get knows how to get the packages:
> 
>    lucifer# apt-get install libgimp2.0
>    Reading Package Lists... Done
>    Building Dependency Tree... Done
>    The following NEW packages will be installed:
>      libgimp2.0
>    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
>    Need to get 435kB of archives.
>    After unpacking 1950kB of additional disk space will be used.
>    Get:1 http://debian.rutgers.edu unstable/main libgimp2.0 2.0.4-1 [435kB]
>    Fetched 435kB in 28s (15.1kB/s)
>    (snip)


Er, big disclaimer, here:  I'm really fuzzy on what the GIMP-related
packages are, and why there would be a libgimp2.0 package distinct from
a gimp1.3 package, which in turn is digtinct from a "gimp" package.  I
have just these on my workstation:

rick at alfredo:~$ dpkg -l gimp | more
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  gimp           2.0.3-2        The GNU Image Manipulation Program,
stable v
You have new mail in /var/mail/rick
rick at alfredo:~$ dpkg -l libgimp | more
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  libgimp        <none>         (no description available)


Anyhow, dpkg is what you use to find out whether something's installed
on your system or not.  It manages packages _locally_.  But it knows
nothing about what packages are and are not available from package
sources listed in /etc/apt/sources.list .  For that, use apt-get.

> Why isn't dpkg giving me a comprehensive list for -l "*gimp*"?  On my
> testing machines, 'dpkg -l "*gimp*" | wc -l' gives me 112...

Hmm, there's some subtle point about dpkg syntax and operation, here,
that's unfamiliar to me.  "dpkg -l *gimp* | wc -l" returns "101" on my
workstation.  Looking at the output without the wc filter shows, among
other things, a tremendous number of successive versions of libgimp that
are not installed at all.  I'm not entirely sure what that's about, but
suggest that the return data you get without using globbing will be more
useful and relevant.

(I'm no expert at this.  I go pretty much strictly by heuristics and
sessions with ye olde manpage.)

-- 
Cheers,     Founding member of the Hyphenation Society, a grassroots-based, 
Rick Moen   not-for-profit, locally-owned-and-operated, cooperatively-managed,
rick at linuxmafia.com     modern-American-English-usage-improvement association.


More information about the vox-tech mailing list