Subsections


The local Debian mirror

Installing packages over the Internet takes a long time. To speed up installations, we keep a local archive of Debian packages in the /usr/local/mirror/ directory. Clients NFS-mount this mirror and download packages from it.

(This section needs to be completely rewritten! We now have two mirrors - one unstructured, and another structured. -P.)

Maintaining the mirror

“Real” mirrors are structured according to a complicated hierarchy. Because we only need a small subset of the entire Debian archive, we just throw all of our packages into

/usr/local/mirror/localdebs/

When we run APT or dselect on our server, it automatically downloads security updates for its installed packages. It stores these new packages in

/var/cache/apt/archives

To move these files to the mirror, become root, then type

mv /var/cache/apt/archives/*.deb /usr/local/mirror

In addition to .deb files, the mirror contains a file called Packages.gz . This file must be updated, or APT will not be able to see the new packages.

To update the Packages.gz file:

  1. Become the root user.

  2. Go to the /usr/local/mirror/ directory:

    cd /usr/local/mirror

  3. Type

    dpkg-scanpackages debs override | gzip > ./debs/Packages.gz

    the “override” file happens to be empty, but is nonetheless a required argument. Ordinarily, its job is to override information specified in .deb files.

Note: When installing new packages on the server, APT will ask you whether you want to “Delete the downloaded .deb files.” You should respond NO, so that these files can be added to the mirror later.

For more information about using local Debian mirrors, refer to the APT HOWTO. (reference? -P.)

Using the mirror

APT and the mirror

APT can use our mirror to download packages. In order to do so, we must modify

/etc/apt/sources.conf

On the server, the entry for the local mirror is as follows:

deb file:/usr/local/mirror localdebs/

(WRONG WRONG WRONGchange this -P.)

On a client machine, the entry for the local mirror is:

deb file:192.168.1.190:/usr/local/mirror debs/

The IP address is the server's. In order to use this mirror, the /usr/local/mirror/ directory should be NFS-mounted. To see how to do this, please see Section (where?? -P.)

fai.conf

The FAI configuration file /etc/fai/fai.conf also contains an APT entry for the server. Clients use this entry to download packages.


base_woody.tgz

In Section 6.3.3, we discuss the need for a base2_2.tgz file. This file can be found at

/usr/local/mirror/base2_2.tgz

It is a symlink to the more descriptively-named base_woody.tgz . (Debian 2.2 was the old Potato distribution. The base file for Woody should be called base3_0.tgz , if we were to follow the naming scheme.)

The base_woody.tgz file contains all the base packages for the debian archive, unpacked into a directory. This archive is created by the debootstrap command.

(Put down the command to build this. Assume we unpack to /tmp/basedebs/ -P.)

debootstrap connects to a Debian server, downloads the base packages for a distribution (Woody in our case), and unpacks it to the specified directory. We then use tar to pack these files up.

To create a new base debs file:

(Put full instructions here -P.)

2004-04-13