wikiからの移植です。
世の中にあふれているであろう設定についてですが、自分的メモな方向性です。
参考にするなら、CPAN初級を僕自身が参考にしたのでそちらを見てもらう方が良いです。
必要なプログラムの確認
whichで各プログラムがあるかどうかを確認。
# which gzip tar make lynx unzip wget ftp
あればパスが出力される。なければ別途インストール
/bin/gzip
/bin/tar
/usr/bin/make
/usr/bin/lynx
/usr/bin/unzip
/usr/bin/wget
/usr/bin/ftp
proxyサーバの設定。使用していなければ、スルーする。使用する場合は、環境変数に以下コマンドで設定する。(urlはdefault)
# export ftp_proxy=http://proxy.you.com:8000/
# export http_proxy=http://proxy.you.com:8000/
CPANのセットアップ
コマンドを入力
# perl -MCPAN -e shell
以下対話形式でセットアップしていくが、何も入力せずリターンしたときは[]内が設定として保存される。以下のところはデフォルトでOKだが、
Parameters for the 'make install' command?で設定が必要になるので注意
Are you ready for manual configuration? [yes]
CPAN build and cache directory? [/root/.cpan]
Cache size for build directory (in MB)? [10]
Perform cache scanning (atstart or never)? [atstart]
Policy on building prerequisites (follow, ask or ignore)?
[follow]
Where is your gzip program? [/usr/bin/gzip]
Where is your tar program? [/usr/bin/tar]
Warning: unzip not found in PATH
Where is your unzip program? [] /usr/bin/unzip
Where is your make program? [/usr/bin/make]
Where is your lynx program? [/usr/bin/lynx]
Warning: ncftpget not found in PATH
Where is your ncftpget program? []
Warning: ncftp not found in PATH
Where is your ncftp program? []
Where is your ftp program? [/usr/bin/ftp]
What is your favorite pager program? [less]
What is your favorite shell? [/bin/bash]
Parameters for the 'perl Makefile.PL' command? []
Parameters for the 'make' command? []
Parameters for the 'make install' command?
ここでUNINST=1と設定しリターン
このUNINST=1は既存のmoduleなどを再度インストールしようとして競合が起こった時に古いものを消す設定である
Parameters for the 'make install' command? [] UNINST=1
proxyの設定。環境変数で設定している場合、デフォルトの[]に入る。最初にproxyの設定を別途行っている。もしくは必要ないので、リターンでOK
Your ftp_proxy? [http://proxy.you.com:8000/]
Your http_proxy? [http://proxy.you.com:8000/]
Your no_proxy?
downloadするCPANサーバの設定
一番近いところにする。日本からはAsiaを選択
(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 2
これまた一番近いところ。日本からはJapan
(1) China
(2) Hong Kong
(3) Indonesia
(4) Israel
(5) Japan
(6) Saudi Arabia
(7) Singapore
(8) South Korea
(9) Taiwan
(10) Thailand
Select your country (or several nearby countries) [] 5
japan内の一覧が出てくるので、これも近そうなサーバを選択
(1) ftp://ftp.dti.ad.jp/pub/lang/CPAN/
(2) ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
(3) ftp://ftp.kddlabs.co.jp/CPAN/
(4) ftp://ftp.meisei-u.ac.jp/pub/CPAN/
(5) ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
(6) ftp://ftp.u-aizu.ac.jp/pub/lang/perl/CPAN/
(7) ftp://mirror.nucba.ac.jp/mirror/Perl/
Select as many URLs as you like [] 1
URLを直接入力することも可能なので、1~7以外を設定する場合は、URLを入力する
URLを直接入力する場合スペルミスやちゃんと稼動しているサーバかどうかチェックしてから入れる。
Enter another URL or RETURN to quit: []
これらの設定は使用しているperlのCPAN/Config.pmに保存される。
お好みで
CPANを使用できるようになったので、まずBundle::LWPをインストールする。
これによりCPANを再起動後はdownloadにlynxではなくLWPを使用するようになる。
>cpan install Bundle::LWP
>cpan install Bundle::CPAN
>cpan install Crypt::SSLeay