[ 前のページ ] [ 目次 ] [ 1 ] [ 2 ] [ 3 ] [ 次のページ ]
APT を両方のマシンで利用できるようにする最も単純な設定を考えます。基本的な考え方は status ファイルのコピーをそのディスクに置いて最新のパッケージファイルの取得やダウンロードするパッケージの決定にはリモートマシンを使います。そのディスクのディレクトリ構造は次のようになります:
/disc/ archives/ partial/ lists/ partial/ status sources.list apt.conf
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 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 disc:
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/"; };
More details can be seen by examining the apt.conf man page and the sample configuration file in /usr/share/doc/apt/examples/apt.conf.
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/. 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 [ package ファイルを APT が取得します ] # apt-get dist-upgrade [ 対象マシンをアップグレードするのに必要なパッケージを、APT が取得します ]
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.
これで、対象のマシンをアップグレードするのに必要な索引ファイルとアーカイブが全てこのディスクに収録されたということになります。ディスクを戻して実行します:
# export APT_CONFIG="/disc/apt.conf" # apt-get check [ キャッシュファイルのローカルコピーを生成します ] # apt-get --no-d -o dir::state::status=/var/lib/dpkg/status dist-upgrade [ もしくはその他の APT コマンド ]
適切に機能するためにはローカルのファイルを status ファイルに再指定する必要があります。これは非常に重要です!
dselect を使っている場合、disc/status はリモートマシンで何か選択すると更新されるため /var/lib/dpkg/status にコピーするのは非常に危険です。選択はローカルマシンでのみ行うことを強く勧めます - しかしこれは常に可能だとは限りません。dpkg や APT を実行している間は status ファイルをコピー *しないでください* !!
[ 前のページ ] [ 目次 ] [ 1 ] [ 2 ] [ 3 ] [ 次のページ ]
オフラインでの APT の使用法
$Id: offline.sgml,v 1.8 2003/02/12 15:06:41 doogie Exp $mailto:jgg@debian.org