This file is indexed.

/usr/share/doc/apt-doc/offline.ja.html/ch2.html is in apt-doc 1.0.9.8.4.

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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>第2章 両方のマシンでの APT の使用法</title>
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="home" href="index.html" title="オフラインでの APT の使用法"/>
    <link rel="up" href="index.html" title="オフラインでの APT の使用法"/>
    <link rel="prev" href="ch1.html" title="第1章 はじめに"/>
    <link rel="next" href="ch3.html" title="第3章 APT と wget の使用"/>
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">第2章 両方のマシンでの APT の使用法</th>
        </tr>
        <tr>
          <td align="left"><a accesskey="p" href="ch1.html">戻る</a> </td>
          <th width="60%" align="center"> </th>
          <td align="right"> <a accesskey="n" href="ch3.html">次へ</a></td>
        </tr>
      </table>
      <hr/>
    </div>
    <div class="chapter">
      <div class="titlepage">
        <div>
          <div>
            <h1 class="title"><a id="ch2"/>第2章 両方のマシンでの APT の使用法</h1>
          </div>
        </div>
      </div>
      <div class="toc">
        <p>
          <strong>目次</strong>
        </p>
        <dl class="toc">
          <dt>
            <span class="section">
              <a href="ch2.html#s2.1">2.1. 概要</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="ch2.html#s2.2">2.2. 設定ファイル</a>
            </span>
          </dt>
        </dl>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="s2.1"/>2.1. 概要</h2>
            </div>
          </div>
        </div>
        <p>
APT を両方のマシンで利用できるようにする最も単純な設定を考えます。基本的な考え方は status
ファイルのコピーをそのディスクに置いて最新のパッケージファイルの取得やダウンロードするパッケージの決定にはリモートマシンを使います。そのディスクのディレクトリ構造は次のようになります:
</p>
        <pre class="screen">
  /disc/
    archives/
       partial/
    lists/
       partial/
    status
    sources.list
    apt.conf
</pre>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="s2.2"/>2.2. 設定ファイル</h2>
            </div>
          </div>
        </div>
        <p>
設定ファイルでは APT
が管理ファイルをそのディスクに保存し、そのディスク上の設定ファイルを同様に利用するように指示する必要があります。sources.list
ではリモートマシンから利用する適切なサイトを指定し、status ファイルは<span class="emphasis"><em>対象ホスト</em></span><span class="emphasis"><em>/var/lib/dpkg/status</em></span>
をコピーしたものを利用します。ローカルアーカイブを使っている場合はその URI を利用しないといけないことに注意してください。書式はファイルの URI
と同一です。
</p>
        <p>
<span class="emphasis"><em>apt.conf</em></span> には APT がそのディスクを使うようにするのに必要な情報を記述しないといけません:
</p>
        <pre class="screen">
 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>
apt.conf の man ページや
<span class="emphasis"><em>/usr/share/doc/apt/examples/apt.conf</em></span>
にある見本の設定ファイルを調べるとさらなる詳細があります。
</p>
        <p>
対象のマシンでまず行うことはディスクをマウントしてそのディスクに <span class="emphasis"><em>/var/lib/dpkg/status</em></span>
をコピーすることです。概要にまとめられているように、ディレクトリ <span class="emphasis"><em>archives/partial/</em></span> 及び
<span class="emphasis"><em>lists/partial/</em></span> を作成する必要もあるでしょう。それからディスクをリモートマシンに移動して
sources.list を設定します。リモートマシンでは以下の手順を実行します:
</p>
        <pre class="screen">
 # export APT_CONFIG="/disc/apt.conf"
 # apt-get update
 [ package ファイルを APT が取得します ]
 # apt-get dist-upgrade
 [ 対象マシンをアップグレードするのに必要なパッケージを、APT が取得します ]
</pre>
        <p>
dist-upgrade コマンドは他の任意の標準的な APT コマンド、特に dselect-upgrade
に置き換えることができます。<span class="emphasis"><em>dselect</em></span> 等の APT
フロントエンドを使うこともできます。しかし、それには選択したときにローカルコンピュータとやりとりしてしまうという問題があります。
</p>
        <p>
これで、対象のマシンをアップグレードするのに必要な索引ファイルとアーカイブが全てこのディスクに収録されたということになります。ディスクを戻して実行します:
</p>
        <pre class="screen">
  # export APT_CONFIG="/disc/apt.conf"
  # apt-get check
  [ キャッシュファイルのローカルコピーを生成します ]
  # apt-get --no-d -o dir::state::status=/var/lib/dpkg/status dist-upgrade
  [ もしくはその他の APT コマンド ]
</pre>
        <p>
適切に機能するためにはローカルのファイルを status ファイルに再指定する必要があります。これは非常に重要です!
</p>
        <p>
dselect を使っている場合、disc/status はリモートマシンで何か選択すると更新されるため /var/lib/dpkg/status
にコピーするのは非常に危険です。選択はローカルマシンでのみ行うことを強く勧めます - しかしこれは常に可能だとは限りません。dpkg や APT
を実行している間は status ファイルをコピー *しないでください* !!
</p>
      </div>
    </div>
    <div class="navfooter">
      <hr/>
      <table width="100%" summary="Navigation footer">
        <tr>
          <td align="left"><a accesskey="p" href="ch1.html">戻る</a> </td>
          <td align="center"> </td>
          <td align="right"> <a accesskey="n" href="ch3.html">次へ</a></td>
        </tr>
        <tr>
          <td align="left" valign="top">第1章 はじめに </td>
          <td align="center">
            <a accesskey="h" href="index.html">ホーム</a>
          </td>
          <td align="right" valign="top"> 第3章 APT と wget の使用</td>
        </tr>
      </table>
    </div>
  </body>
</html>