Chapter 3. Using APT and wget

Table of Contents

3.1. Overview
3.2. Operation

wget is a popular and portable download tool that can run on nearly any machine. Unlike the method above this requires that the Debian machine already has a list of available packages.

The basic idea is to create a disc that has only the archive files downloaded from the remote site. This is done by using the --print-uris option to apt-get and then preparing a wget script to actually fetch the packages.

Unlike the previous technique no special configuration files are required. We merely use the standard APT commands to generate the file list.

 # apt-get dist-upgrade
 [ Press no when prompted, make sure you are happy with the actions ]
 # apt-get -qq --print-uris dist-upgrade > uris
 # awk '{print "wget -O " $2 " " $1}' < uris > /disc/wget-script

Any command other than dist-upgrade could be used here, including dselect-upgrade.

The /disc/wget-script file will now contain a list of wget commands to execute in order to fetch the necessary archives. This script should be run with the current directory as the disc's mount point so as to save the output on the disc.

The remote machine would do something like

  # cd /disc
  # sh -x ./wget-script
  [ wait.. ]

Once the archives are downloaded and the disc returned to the Debian machine installation can proceed using,

  # apt-get -o dir::cache::archives="/disc/" dist-upgrade

Which will use the already fetched archives on the disc.