/usr/share/doc/apt-doc/offline.html/ch2.html is in apt-doc 0.8.16~exp12ubuntu10.21.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using APT Offline - Using APT on both machines</title>
<link href="index.html" rel="start">
<link href="ch1.html" rel="prev">
<link href="ch3.html" rel="next">
<link href="index.html#contents" rel="contents">
<link href="index.html#copyright" rel="copyright">
<link href="ch1.html" rel="chapter" title="1 Introduction">
<link href="ch2.html" rel="chapter" title="2 Using APT on both machines">
<link href="ch3.html" rel="chapter" title="3 Using APT and wget">
<link href="ch1.html#s1.1" rel="section" title="1.1 Overview">
<link href="ch2.html#s2.1" rel="section" title="2.1 Overview">
<link href="ch2.html#s2.2" rel="section" title="2.2 The configuration file">
<link href="ch3.html#s3.1" rel="section" title="3.1 Overview">
<link href="ch3.html#s3.2" rel="section" title="3.2 Operation">
</head>
<body>
<p><a name="ch2"></a></p>
<hr>
<p>
[ <a href="ch1.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch1.html">1</a> ]
[ 2 ]
[ <a href="ch3.html">3</a> ]
[ <a href="ch3.html">next</a> ]
</p>
<hr>
<h1>
Using APT Offline
<br>Chapter 2 - Using APT on both machines
</h1>
<hr>
<h2><a name="s2.1"></a>2.1 Overview</h2>
<p>
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:
</p>
<pre>
/disc/
archives/
partial/
lists/
partial/
status
sources.list
apt.conf
</pre>
<hr>
<h2><a name="s2.2"></a>2.2 The configuration file</h2>
<p>
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 <em>/var/lib/dpkg/status</em> from the
<em>target host</em>. Please note, if you are using a local archive you must
use copy URIs, the syntax is identical to file URIs.
</p>
<p>
<em>apt.conf</em> must contain the necessary information to make APT use the
disc:
</p>
<pre>
APT
{
/* This is not necessary if the two machines are the same arch, it tells
the remote APT what architecture the target 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 locally
Cache::archives "/disc/archives/";
Cache "/tmp/";
// Location of the source list.
Etc "/disc/";
};
</pre>
<p>
More details can be seen by examining the apt.conf man page and the sample
configuration file in <em>/usr/share/doc/apt/examples/apt.conf</em>.
</p>
<p>
On the target machine the first thing to do is mount the disc and copy
<em>/var/lib/dpkg/status</em> to it. You will also need to create the
directories outlined in the Overview, <em>archives/partial/</em> and
<em>lists/partial/</em>. Then take the disc to the remote machine and
configure the sources.list. On the remote machine execute the following:
</p>
<pre>
# 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 the target machine ]
</pre>
<p>
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
<em>dselect</em>. However this presents a problem in communicating your
selections back to the local computer.
</p>
<p>
Now the disc contains all of the index files and archives needed to upgrade the
target machine. Take the disc back and run:
</p>
<pre>
# export APT_CONFIG="/disc/apt.conf"
# apt-get check
[ APT generates a local copy of the cache files ]
# apt-get --no-d -o dir::state::status=/var/lib/dpkg/status dist-upgrade
[ Or any other APT command ]
</pre>
<p>
It is necessary for proper function to re-specify the status file to be the
local one. This is very important!
</p>
<p>
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!!
</p>
<hr>
<p>
[ <a href="ch1.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch1.html">1</a> ]
[ 2 ]
[ <a href="ch3.html">3</a> ]
[ <a href="ch3.html">next</a> ]
</p>
<hr>
<p>
Using APT Offline
</p>
<address>
$Id: offline.sgml,v 1.8 2003/02/12 15:06:41 doogie Exp $<br>
<br>
Jason Gunthorpe <code><a href="mailto:jgg@debian.org">jgg@debian.org</a></code><br>
<br>
</address>
<hr>
</body>
</html>
|