From a66a514f8302f88d08e292f1c7a94689d45cb801 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:52:52 +0000 Subject: [PATCH] Offline document Author: jgg Date: 1999-02-15 06:38:03 GMT Offline document --- doc/files.sgml | 4 +- doc/makefile | 2 +- doc/offline.sgml | 221 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 doc/offline.sgml diff --git a/doc/files.sgml b/doc/files.sgml index 1b0f166e0..2b68cf9bc 100644 --- a/doc/files.sgml +++ b/doc/files.sgml @@ -4,7 +4,7 @@ APT Files Jason Gunthorpe jgg@debian.org -$Id: files.sgml,v 1.6 1999/02/15 05:29:10 jgg Exp $ +$Id: files.sgml,v 1.7 1999/02/15 06:38:03 jgg Exp $ This document describes the complete implementation and format of the @@ -13,7 +13,7 @@ views the Debian archive. -Copyright © Jason Gunthorpe, 1998. +Copyright © Jason Gunthorpe, 1998-1999.

"APT" and this document are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published diff --git a/doc/makefile b/doc/makefile index d161f708f..190d0622d 100644 --- a/doc/makefile +++ b/doc/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak # SGML Documents SOURCE = dpkg-tech.sgml design.sgml files.sgml guide.sgml cache.sgml \ - method.sgml + method.sgml offline.sgml include $(DEBIANDOC_H) # Man pages diff --git a/doc/offline.sgml b/doc/offline.sgml new file mode 100644 index 000000000..0d33caaf4 --- /dev/null +++ b/doc/offline.sgml @@ -0,0 +1,221 @@ + + + +Using APT Offline + +Jason Gunthorpe jgg@debian.org +$Id: offline.sgml,v 1.1 1999/02/15 06:38:03 jgg Exp $ + + +This document describes how to use APT in a non-networked environment, +specificaly a 'sneaker-net' approach for performing upgrades. + + + +Copyright © Jason Gunthorpe, 1999. +

+"APT" and this document are free software; you can redistribute them and/or +modify them under the terms of the GNU General Public License as published +by the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +

+For more details, on Debian GNU/Linux systems, see the file +/usr/doc/copyright/GPL for the full license. + + + + +Introduction + + +Overview + +

+Normally APT requires direct access to a Debian archive, either from a local +media or through a network. Another common complaint is that a Debian machine +is on a slow link, such as a modem and another machine has a very fast +connection but they are physically distant. + +

+The solution to this is to use large removable media such as a Zip disc or a +SuperDisk disc. These discs are not large enough to store the entire Debian +archive but can easially fit a subset large enough for most users. The idea +is to use APT to generate a list of packages that are required and then fetch +them onto the disc using another machine with good connectivity. It is +even Possible to use another Debian machine with APT or to use a completely +different OS and a download tool like wget. + +

+This is achived by creatively manipulating the APT configuration file. The +essential premis to tell APT to look on a disc for it's archive files. Note +that the disc should be formated with a filesystem that can handle long file +names such as ext2, fat32 or vfat. + + + + +Using APT on both machines + + +Overview + +

+APT being available on both machines gives the simplest configuration. The +basic idea is to place a copy of the status file on the disc and use the +remote machine to fetch the latest package files and decide which packages to +download. The disk directory structure should look like: + + + /disc/ + archives/ + partial/ + lists/ + partial/ + status + sources.list + apt.conf + + + + + + +The configuration file + +

+The configuration file should tell APT to store its files on the disc and +to use the configuration files on the disc as well. The sources.list should +contain the proper sites that you wish to use from the remote machine, and +the status file should be a copy of /var/lib/dpkg/status. Please note, +if you are using a local archive you must use copy URIs, the syntax is identical +to file URIs. + +

+apt.conf must contain the necessary information to make APT use the +disc: + + + APT + { + /* This is not necessary if the two machines are the same arch, it tells + the remote APT what architecture the Debian machine is */ + Architecture "i386"; + + Get::Download-Only "true"; + }; + + Dir + { + /* Use the disc for state information and redirect the status file from + the /var/lib/dpkg default */ + State "/disc/"; + State::status "status"; + + // Binary caches will be stored localy + Cache::archives "/disc/archives/"; + + // Location of the source list. + Etc "/disc/"; + }; + + +More details can be seen by examining the apt.conf man page and the sample +configuration file in /usr/doc/apt/examples/apt.conf. + +

+On the Debian machine the first thing to do is mount the disc and copy +/var/lib/dpkg/status to it. You will also need to create the directories +outlined in the Overview, archives/partial/ and lists/partial/ +Then take the disc to the remote machine and configure the sources.list. +On the remote machine execute the following: + + + # export APT_CONFIG="/disc/apt.conf" + # apt-get update + [ APT fetches the package files ] + # apt-get dist-upgrade + [ APT fetches all the packages needed to upgrade your machine ] + + +The dist-upgrade command can be replaced with any-other standard APT commands, +you can even use an APT front end such as gnome-apt [still in +development]. + +

+Now the disc contains all of the index files and archives needed to upgrade +the Debian machine. Take the disc back and run: + + + # export APT_CONFIG="/disc/apt.conf" + # apt-get check + [ APT generates a local copy of the cache files ] + # apt-get --no-d -o dir::etc::status=/var/lib/dpkg/status dist-upgrade + [ Or any other APT command ] + + +

+It is necessary for proper function to re-specify the status file to be the +local one. This is very important! + + + + +Using APT and wget + + +Overview + +

+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. + + + + + +Operation + +

+Unlike the previous techinque no special configuration files are required. We +mearly 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 + + +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. + + + + -- 2.45.2