l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2001 Dec 30 17:09

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] the scoop behind dpkg/dselect and apt
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] the scoop behind dpkg/dselect and apt

dear vox-tech,

i found this to be an extremely informative email.  since many people around
these parts have started to use debian (or are curious about debian), i'm
posting it to vox-tech.


----- Forwarded message from Colin Watson <cjwatson@debian.org> -----

Date: Mon, 24 Sep 2001 18:47:07 -0500
From: Colin Watson <cjwatson@debian.org>
To: debian-user@lists.debian.org
Subject: Re: apt-get wierdness:  when 6 is equal to 9
X-Mailing-List: <debian-user@lists.debian.org> archive/latest/171204

On Mon, Sep 24, 2001 at 12:21:39PM -0700, Peter Jay Salzman wrote:
> begin: Hereward Cooper <zadok@phreaker.net> quote
> > once upon a time Peter Jay Salzman <p@dirac.org> said:
> > > problem: two systems with the same sources.list don't know about the
> > > same available packages.
> > 
> > have you tried running the update selection from dselect. I think the
> > problem is that dpkg only lists the files from the package list when
> > updated via dselect. Or alternativly you could use "apt-cache search
> > <filename>" which would use the apt package list.
> thanks for the reply.  so dselect and apt contain different views of what
> packages are on the system?

Never of what packages are on the system, as far as I know, but perhaps
of what packages are available. When apt-get says "Reading Package
Lists", one of the things it's reading in is dpkg's status file.

dpkg and dselect are the original package management systems, more or
less. They functioned as a pair: dpkg handled low-level (through
dpkg-deb) and medium-level functions, while dselect handled the
high-level primary user interface. They are still built from the same
source tree, and interface rather closely with each other. Thus, any
time you ask dpkg for information, the tool you should expect to have
updated it is dselect.

apt (originally deity) was written, I think, in large part out of
frustration that dpkg/dselect weren't really being developed very
actively at the time, and in an attempt to produce a better user
interface than dselect. apt also has its own database of available
package information, which is in a binary format and much faster than
dpkg's text-based available file; in certain situations, which I'll
describe in a moment, the two are synchronized.

The first and still the most widely-known tool that they produced on top
of the libapt-pkg library was apt-get, which was originally basically a
debugging tool (the man page describes it as 'the user's "back-end" to
other tools using the APT library'). People started using it as their
primary package management front-end, and it ended up being what a lot
of people think of as apt. The full-scale dselect replacements are still
in development, although some of them are reaching maturity now.

What apt *also* succeeded in producing, though, was a much better set of
back-ends to dselect. People used to use various things like the ftp,
mountable, and cdrom methods: these were all fairly buggy to one degree
or another, and apt managed to become a fantastic replacement for all of
them. If you use apt that way, through dselect rather than through the
incomplete tool apt-get, then you'll find that dpkg's and apt's package
databases stay in sync.

> just tried it -- i think you're right.  imho, this goes beyond
> inelegance, and borders on a bug that needs to be fixed.  it's
> unthinkable that there are two databases of available packages which
> are out of sync everytime we choose apt over dselect or dselect over
> apt.

Somewhat. Mostly it's a documentation bug. Far too many of the
intentions of apt and apt-get are buried in oral history, so people keep
asking things like why apt-get doesn't handle recommends and suggests.
Far too many people aren't aware, it seems, that you can use dselect and
apt simultaneously and have everything work.

I wish, though, that apt-get would tell you that it hasn't updated
dpkg's database. The 'apt-get update' versus 'dselect update' thing is
an incredibly frequently asked question.

> seems like debian should strive to make apt and dselect front ends for
> the same package management system.   :(

They are, more or less. It's just that apt-get is one component of it
which doesn't interact with other components at the level you're
expecting. I agree that it's confusing.

With regard to 'dpkg -l', I'm not sure that it's ever been guaranteed to
work the way you want. 'dpkg -l' looks in /var/lib/dpkg/status, while
you want information from /var/lib/dpkg/available. Unless something has
explicitly synchronized one with the other, you won't get the
information you're looking for: it really only displays available
package information by luck. If dpkg's database is up to date, you want
'dpkg -p' or similar.


Colin Watson                                  [cjwatson@flatline.org.uk]

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.