Webとメールに特化したクラウド型レンタルサーバー。php5.3 MySQL5.1 root権限 ssh対応、複数ドメイン。色々対応で月額5,250円!!

11月 01

某バンドが復活しました。来春が待ち遠しい@msmです。

yumをyum-fastestmirror(yum-plugin-fastestmirror)で加速するに続き、今度はDebian 4.0 etchにてaptを加速します。

netselect-aptは高速なミラーを探すスクリプトですので、実行後にsoucelistを書き換える必要があります。なお、netselect-aptはyumのfastestmirrorとは違い、毎回速いミラーを見つけ選択してくれるものではありません。
それでも、サイズの大きいパッケージのインストールや複数のパッケージのアップデートをする直前に利用された場合には、かなりの速度アップが期待できますので、一応お勧めです。
 

netselect-aptをインストールする

rootアカウントで以下のコマンドを実行します。

# apt-get install netselect-apt

wgetとnetselectが未インストールの場合は依存関係がありますので自動的にインストールされます。

netselect-aptを実行する

Debian 4.0 etchを利用していますので最後にetchを入れ実行します。

# cd /tmp
# netselect-apt etch 

Using distribution etch.
Retrieving the list of mirrors from www.debian.org... 

--02:26:17--  http://www.debian.org/mirror/mirrors_full
           => `mirrors_full'
www.debian.org をDNSに問いあわせています... 194.109.137.218
www.debian.org|194.109.137.218|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 199,063 (194K) [text/html] 

100%[=====================>] 199,063       41.51K/s    ETA 00:00 

02:26:23 (41.46 KB/s) - `mirrors_full' を保存しました [199063/199063] 

Choosing a main Debian mirror using netselect.
netselect: unknown host ftp.coe.psu.ac.th
Running netselect to choose 1 out of 360 addresses.
......................................................................
......................................................................
...................................................................... 

The fastest server seems to be: 

http://203.16.234.86/debian/

Writing sources.list.

最後の「http://203.16.234.86/debian/」が今回置き換える高速なミラーサーバとなります。

soucelistを変更する

「/etc/apt/sources.list」のミラーサーバーを変更します。

mv /etc/apt/sources.list /etc/apt/sources.list.old
sed 's/ftp.jp.debian.org/203.16.234.86/g'  /etc/apt/sources.list.old > /etc/apt/sources.list

上記は「ftp.jp.debian.org」を「203.16.234.86」に変更した場合です、環境に合わせて置き換えてください。

投稿者: @msm
Trackback URL:

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes