APT with random-access removable media HOWTO by James Cameron, 2006-08-23 Synopsis Describes how to upgrade non-connected or low-speed linked Debian systems using APT with random-access removable media. Pictures & Diagrams See *.png Types of removable media - write-once sequential-access (CD-R) [not supported] - write-many sequential-access (CD-RW) [not supported] - write-many random-access (USB storage) [supported] Types of random-access removable media - floppy disk (too small these days) - zip drive (too rare these days) - USB pen drive (/dev/uba) - USB hard disc drive - IDE removable drive Relevant features of APT - uses dpkg's /var/lib/dpkg/status to choose upgrade packages - keeps package lists in /var/lib/apt/lists - keeps package archives in /var/cache/apt/archives - can be told to use any of these on removable media Assumptions - removable media is mounted exec and writable - all but package installation can be non-root Basic Procedure - obtain the status file from the target system, e.g. by e-mail, ssh, or as part of a prior visit, - maintain a package list on the removable media, updating it in the same way "apt-get update" works, - when well connected, download the packages required onto the removable media, - travel to the target system, run the apply script. Phase 0, Structure Aim: to build filesystem structure on removable media. Why: to enable the following procedures to work. - insert media in target system, - mount filesystem, - unpack the .tar.gz, - run the tree script, - umount filesystem, - remove media. Phase 1, Adopt Aim: obtain the list of package versions installed. Why: so that the fetch phase knows what to get. - insert media in target system, - mount filesystem, - run the adopt script, supplying the system name, - umount filesystem, - remove media. Phase 2, Update Aim: to update the package list on the media. Why: so that the fetch phase knows what to get. Why: so that the target system can be updated with the new list. - insert media in either system, - mount filesystem, - ensure internet connection is live, - run the update script, - umount filesystem, - remove media. Phase 3, Fetch Aim: to download the packages required by a target system. Why: so that the packages can be carried on the media. - insert media in either system, - mount filesystem, - ensure internet connection is live, - run the fetch script, once for each target system, [see the poll script for a combination update and fetch] - umount filesystem, - remove media. Phase 4, Apply Aim: to update the target system's package list. Aim: to upgrade the target system packages from the media. - insert media in target system, - mount filesystem, - run the apply script, - umount filesystem, - remove media. Phase 5, Clean by exclusion Aim: to maintain free space on the media. Why: to prevent a fetch from failing due to lack of space. - insert media in either system, - mount filesystem, - run the clean-by-exclusion script, - umount filesystem, - remove media.