X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a66a514f8302f88d08e292f1c7a94689d45cb801..1afd369d00f2f9272462ffc6c6e24f293a81459e:/doc/offline.sgml?ds=sidebyside diff --git a/doc/offline.sgml b/doc/offline.sgml index 0d33caaf4..659ca3147 100644 --- a/doc/offline.sgml +++ b/doc/offline.sgml @@ -1,14 +1,14 @@ - + Using APT Offline Jason Gunthorpe jgg@debian.org -$Id: offline.sgml,v 1.1 1999/02/15 06:38:03 jgg Exp $ +$Id: offline.sgml,v 1.8 2003/02/12 15:06:41 doogie Exp $ This document describes how to use APT in a non-networked environment, -specificaly a 'sneaker-net' approach for performing upgrades. +specifically a 'sneaker-net' approach for performing upgrades. @@ -20,8 +20,8 @@ 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. +For more details, on Debian systems, see the file +/usr/share/common-licenses/GPL for the full license. @@ -40,15 +40,17 @@ 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 +archive but can easily 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. +even possible to use another Debian machine with APT or to use a completely +different OS and a download tool like wget. Let remote host mean the +machine downloading the packages, and target host the one with bad or +no connection.

-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 +This is achieved by creatively manipulating the APT configuration file. The +essential premise 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. @@ -87,9 +89,9 @@ download. The disk directory structure should look like: 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. +the status file should be a copy of /var/lib/dpkg/status from the +target host. 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 @@ -99,7 +101,7 @@ 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 */ + the remote APT what architecture the target machine is */ Architecture "i386"; Get::Download-Only "true"; @@ -112,21 +114,22 @@ disc: State "/disc/"; State::status "status"; - // Binary caches will be stored localy + // Binary caches will be stored locally Cache::archives "/disc/archives/"; - + Cache "/tmp/"; + // 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. +configuration file in /usr/share/doc/apt/examples/apt.conf.

-On the Debian machine the first thing to do is mount the disc and copy +On the target 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/ +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: @@ -135,22 +138,23 @@ On the remote machine execute the following: # apt-get update [ APT fetches the package files ] # apt-get dist-upgrade - [ APT fetches all the packages needed to upgrade your machine ] + [ APT fetches all the packages needed to upgrade the target 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]. +The dist-upgrade command can be replaced with any other standard APT commands, +particularly dselect-upgrade. You can even use an APT front end such as +dselect. However this presents a problem in communicating your +selections back to the local computer.

Now the disc contains all of the index files and archives needed to upgrade -the Debian machine. Take the disc back and run: +the target 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 + # apt-get --no-d -o dir::state::status=/var/lib/dpkg/status dist-upgrade [ Or any other APT command ] @@ -158,6 +162,13 @@ the Debian machine. Take the disc back and run: It is necessary for proper function to re-specify the status file to be the local one. This is very important! +

+If you are using dselect you can do the very risky operation of copying +disc/status to /var/lib/dpkg/status so that any selections you made on the +remote machine are updated. I highly recommend that people only make selections +on the local machine - but this may not always be possible. DO NOT copy +the status file if dpkg or APT have been run in the mean time!! + @@ -183,8 +194,8 @@ 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. +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 @@ -193,6 +204,10 @@ mearly use the standard APT commands to generate the file list. # 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