2015年8月22日土曜日

[CentOS5] コマンドラインでTorrentクライアントを使う


Linux環境のコマンドラインで torrent クライアントを実行して、CentOS5.3のインストール用DVDのISOイメージをダウンロードしてみます。

torrentクライアントには、「Enhanced CTorrent」というアプリケーションを使用します。(無料)
Sourceforge で配布しているので、ソースをダウンロードして、コンパイルし、インストールします。

1.「Enhanced CTorrent」 のダウンロード


以下のようにwgetコマンドを実行して、ソースをダウンロードします。
# wget http://sourceforge.net/projects/dtorrent/files/dtorrent/3.3.2/ctorrent-dnh3.3.2.tar.gz/download

2. 「Enhanced CTorrent」 のコンパイル&インストール


まず、上記1で取得したソースを解凍します。
# tar xvfz ctorrent-dnh3.3.2.tar.gz
コンパイルします。 "c++のコンパイラ" が必要です。なければ "yum install gcc-c++" とすればインストールできます。
# cd ctorrent-dnh3.3.2
# ./configure
# make install
# hash

3.CentOS5.3  の DVDイメージ用 torrent ファイルをダウンロード


以下のようにwgetコマンドを実行して、ダウンロードします。
# wget http://ftp.iij.ad.jp/pub/linux/centos/5.3/isos/i386/CentOS-5.3-i386-bin-DVD.torrent

4.CentOS5.3  の DVDイメージをダウンロード


以下のように torrentクライアントのコマンド( ctorrent )を実行して、ISOイメージダウンロードします。
# ctorrent CentOS-5.3-i386-bin-DVD.torrent