Go to TogaWare.com Home Page. Note this image has an 
              incorrect black background on MS - Use Linux!

Debian GNU/Linux

Maintaining a Distribution Archive

next up previous contents index

The apt method within dselect and the apt-get command (which the apt mathod uses) place all downloaded files into /var/cache/apt/archive. You can then use the apt-move command to move the archived files into a local hierarchy that mirrors a standard distribution hierarchy. Then you can point apt-get to this local archive by pointing to it from /etc/apt/sources.list using the file:// format. You can also give the option apt-get-download-only to apt-get to download but not unpack nor install the package.

To set up a local machine as a local (partial) mirror of the Debian archive, first install apt-move:

  $ wajig install apt-move

Then edit /etc/apt-move.conf to add the sites that appear in /etc/apt/sources.list (replacing slashes with underscores and the following may need to all be on one line):

  APTSITES="mirror.aarnet.edu.au_pub_debian
            ftp.debian.org_debian 
            non-US.debian.org 
            security.debian.org"

Then remove all architectures not of interest from the ARCHS variable and DIST:

  ARCHS="i386 sparc"
  DIST=unstable

The apt-move command is then used to install any packages in your /var/cache/apt/archives into the Debian mirror being created:

  # apt-move update

You can also create a complete mirror with:

  # apt-move mirror

These commands place the mirror into /mirrors/debian. To make it available on your web server simply:

  # cd /var/www
  # ln -s /mirrors pub

The /etc/apt/sources.list file can then be updated to point to the new archive as the first place to check for packages (place these lines first in the file):

  deb http://togaware.com/pub/debian unstable main contrib non-free
  deb http://togaware.com/pub/debian unstable/non-US main contrib non-free

All of this might happen on your server, yet your server is not likely to be the most up to date machine. Suppose your experimental machine (always kept up to date) is Inco (4.10.24). You can rsync all packages in /var/cache/apt/archives on Inco (4.10.24) to your sever (e.g., Altrop), then on Altrop run apt-move (and also remove the original files from the archive on Inco (4.10.24)):

  # rsync -v inx:/var/cache/apt/archives/* /var/cache/apt/archives/
  # ssh inx wajig clean         (or apt-get clean)
  # apt-move update             (soon to be wajig move)

next up previous contents index

Copyright (c) 2003-2004 Graham.Williams@togaware.com