FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 05-09-2011, 10:48 AM
Ciaran Carthy
 
Default dpkg and apt status files.

I ask the following questions not to troubleshoot a poblem I am
having but rather to know whats going on behind the scenes with
package management. I know that apt is not part of dpkg. Hope nobody
minds me bringing it into the discussion.



I have read up on Debian Package Management as much as I can at
this stage.
Thanks to the Debian Policy manual, I*understand how the remote
repositories*are structured
and how sources.list is used to consult the repositories*to
locate*updates.
*
I understand what is contained in a package file and that it
has everything required
to install AND remove a package. I have delved into the
/var/lib/dpkg directory and
I understand that the info sub directory contains the scripts
and information needed to remove a package.
So far so good.
*
My confusion begins with these files:
/var/cache/apt/pkgcache.bin
/var/lib/dpkg/status
/var/lib/dpkg/available
*
I have observed that it doesn't really matter if pkgcache.bin
doesn't exist because apt-get update
quickly rebuilds it to its full size. Does it rebuild it by
trawling through the repository again?
What is it used for/what does it contain? It would seem to be
redundant based on what the next two files
are used for.
*
In the /var/lib/dpkg directory there are two important files: available
and status.
status is the most important one as nothing will work if it is
lost or corrupted.
Both contain the standard control information on each package.
status,
on my machine, only contains descriptions of packages that are
actually installed.
This seems to be the definitive source for determining that a
package is installed.
If you remove a package it is removed from the status file. I
presume apt-get
relies on status to tell*if a package is already installed?
What is "available" for and how is it built up?
My understanding is that dpkg does not have the concept of a
configured remote repository.
So in the world of dpkg, what does it mean to say that a
package is "available"?
*
Thanks in advance for the help,
Ciaran
 
Old 05-09-2011, 12:34 PM
Raphael Hertzog
 
Default dpkg and apt status files.

On Mon, 09 May 2011, Ciaran Carthy wrote:
> quickly rebuilds it to its full size. Does it rebuild it by trawling
> through the repository again?

AFAIK yes.

> What is it used for/what does it contain? It would seem to be
> redundant based on what the next two files are used for.

It's the list of available packages known to APT.

> In the /var/lib/dpkg directory there are two important files:
> *available *and *status*.
[...]
> This seems to be the definitive source for determining that a
> package is installed.

Yes.

> What is "available" for and how is it built up?
> My understanding is that dpkg does not have the concept of a
> configured remote repository.
> So in the world of dpkg, what does it mean to say that a package is
> "available"?

The available file is mainly useful for dselect. It's maintained by dpkg
but fed by external programs/scripts via "dpkg --update-avail" (and/or
--merge-avail). For historical reasons, it also keeps the information of
packages that have been installed in the past (dpkg -i adds the info both
to the available file and to the status file).

This file is not used by APT.

Cheers,
--
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
▶ http://RaphaelHertzog.fr (Français)


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110509123452.GD24217@rivendell.home.ouaza.com">h ttp://lists.debian.org/20110509123452.GD24217@rivendell.home.ouaza.com
 
Old 05-12-2011, 07:29 PM
Goswin von Brederlow
 
Default dpkg and apt status files.

Raphael Hertzog <hertzog@debian.org> writes:

> On Mon, 09 May 2011, Ciaran Carthy wrote:
>> quickly rebuilds it to its full size. Does it rebuild it by trawling
>> through the repository again?
>
> AFAIK yes.

Actually apt-get, apt-cache, ... use them if they are current, rebuild
them if they have write access and otherwise just rebuild them in
memory. It is purely an optimization to avoid having to parse the
Packages/Sources files on every invocation.

>> What is it used for/what does it contain? It would seem to be
>> redundant based on what the next two files are used for.
>
> It's the list of available packages known to APT.
>
>> In the /var/lib/dpkg directory there are two important files:
>> *available *and *status*.
> [...]
>> This seems to be the definitive source for determining that a
>> package is installed.
>
> Yes.
>
>> What is "available" for and how is it built up?
>> My understanding is that dpkg does not have the concept of a
>> configured remote repository.
>> So in the world of dpkg, what does it mean to say that a package is
>> "available"?
>
> The available file is mainly useful for dselect. It's maintained by dpkg

Is anything but dselect using this (not just filling it like dpkg but
actually using it)?

> but fed by external programs/scripts via "dpkg --update-avail" (and/or
> --merge-avail). For historical reasons, it also keeps the information of
> packages that have been installed in the past (dpkg -i adds the info both
> to the available file and to the status file).
>
> This file is not used by APT.

If you do not use dselect you can save some disk space by running dpkg
--clear-avail. One can even add this as hook to apt-conf.d so it doesn't
kepp growing back.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87sjsjsonh.fsf@frosties.localnet">http://lists.debian.org/87sjsjsonh.fsf@frosties.localnet
 

Thread Tools




All times are GMT. The time now is 04:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org