Ubuntuのリポジトリミラー
1月と2月にも書いたUbuntu 9.10 (karmic koala)のノウハウ。
複数台のマシンをセットアップしたり、aptパッケージの版数を管理する必要がある場合は、リポジトリミラーを立てておいた方が良い。
基本的には
$ sudo aptitude install apt-mirrorでapt-mirrorインストールし、cron等で定期的にパブリックマスターと同期させるだけ。意外に簡単だ。
apt-mirrorの設定は/etc/apt/mirror.listで、こんな感じ。
############# config ##################通常はset defaultarch i386を設定して
#
# set base_path /var/lib/apt-mirror
#
# if you change the base path you must create the directories below with write privileges
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarcharchitecture>
# set postmirror_script $var_path/postmirror.sh
set base_path /var/lib/apt-mirror
set mirror_path $base_path/mirror
set skel_path $base_path/skel
set var_path $base_path/var
set cleanscript $var_path/clean.sh
#set defaultarch i386
set postmirror_script $var_path/postmirror.sh
set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
deb-i386 http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb-i386 http://archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
#deb-i386 http://archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb-amd64 http://archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
#deb-amd64 http://archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
deb http://archive.ubuntu.com/ubuntu …を列挙していけば良いが、今回はi386に加えてamd64もミラーする必要があったので、deb-i386とdeb-amd64に分けて書く必要があるというのがポイント。