HTTPは使えるけど、FTPが利用できない環境で、CPAN環境を構築する。
OS は Debian Sarge.

まず、root にて


# perl -MCPAN -e shell

という感じで、CPAN環境を構築していく。
いろいろ訊ねてくるが、ほとんどデフォルト値で返答。

コマンド関係は、別のシェルを起動してインストールしつつ、そのパスを自分で指定。
たとえば、unzip が見つからないと言われて、その場で apt-get install unzip とか。必要あるかわからんけど。


Where is your gzip program? [/bin/gzip]
Where is your tar program? [/bin/tar]
Warning: unzip not found in PATH
Where is your unzip program? [] /bin/unzip

FTP を使えない状況でも FTP 関連の質問がくる。が、そのまま Enter 連打。


Your ftp_proxy?
Your http_proxy?
Your no_proxy?
You have no /root/.cpan/sources/MIRRORED.BY
  I'm trying to fetch one
LWP not available
CPAN: Net::FTP loaded ok
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY

FTP が使えないので、ここでカタまってしまう。
ので、ここから [Ctrl] + C を連打。


Fetching with Net::FTP
  ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz
 
Trying with "/usr/bin/lynx -source" to get
    ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY

気にせず、[Ctrl] + C でドコドコ進む。
いいかげん、つながらない "Not connected" と怒られる。
このへんから連打減速。


Not connected.
Local directory now /root/.cpan/sources
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Bad luck... Still failed!
Can&apost access URL ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.
 
Please check, if the URLs I found in your configuration file () are valid.
The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'
 
Could not fetch MIRRORED.BY
CPAN.pm needs at least one URL where it can fetch CPAN files from.
 

このへんでようやく CPAN site を入力するよう促してくる。


Please enter your CPAN site: []

と聞いてくるので、CPAN/SITES から良さげなサイトを選んで入力する。当然 http://~なサイトを選ぶ。ここでは http://ftp.cpan.jp/ を入力した。


Please enter your CPAN site: [] http://ftp.cpan.jp/
Enter another URL or RETURN to quit: []
New set of picks:
  http://ftp.cpan.jp/
 
 
commit: wrote /etc/perl/CPAN/Config.pm
Terminal does not support AddHistory.
 
cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support available (try 'install Bundle::CPAN')

あとは、こころおきなくモジュールをインストールする。


cpan< install Authen::Captcha
cpan< install GD::SecurityImage

参考: CPAN経由でLinuxにモジュールを組み込む


コメント

きょう、入力しなかった?

http://b.hatena.ne.jp/entry/http://www.nilab.info/zurazure2/archives/000246.html
はてなブックマークのコメント

id:xnissy さんによると「CPAN siteにhttpなサイトを選べばいいのか.でもその前の段階,^C押したら終了しちゃいましたよ.」とのこと。

あれ? そういうこともあるのかな?

tags: zlashdot Perl Perl

Posted by NI-Lab. (@nilab)