CentOS5.6で、CPAN(The Comprehensive Perl Archive Network)を利用する際のセットアップ
(1)必要なモノをepelリポジトリからyumでインストールする
epelリポジトリ利用のための設定は、次のパッケージをインストールするだけで自動的になされる。
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# yum install ncftp
ncftpは高機能のファイル転送プログラムらしい。
次に行うCPAN利用のためのセットアップではこのプログラムがなければ進めない。
(2)CPAN利用のためのセットアップを行う
初回のみいろいろ質問される。セットアップ後は同じコマンドでCPANのプロンプトがすぐに現れる。
セットアップでは最後の方で質問される国の選択とリポジトリの選択以外はエンターキーでデフォルトを選択すればよい。
# perl -MCPAN -e shell/usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.CPAN is the world-wide archive of perl resources. It consists of about100 sites that all replicate the same contents all around the globe.Many countries have at least one CPAN site already. The resourcesfound on CPAN are easily accessible with the CPAN.pm module. If youwant to use CPAN.pm, you have to configure it properly.If you do not want to enter a dialog now, you can answer 'no' to thisquestion and I'll try to autoconfigure. (Note: you can revisit thisdialog anytime later by typing 'o conf init' at the cpan prompt.)Are you ready for manual configuration? [yes]The following questions are intended to help you with theconfiguration. The CPAN module needs a directory of its own to cacheimportant index files and maybe keep a temporary mirror of CPAN files.This may be a site-wide directory or a personal directory.First of all, I'd like to create this directory. Where?CPAN build and cache directory? [/root/.cpan]If you want, I can keep the source files after a build in the cpanhome directory. If you choose so then future builds will take thefiles from there. If you don't want to keep them, answer 0 to thenext question.How big should the disk cache be for keeping the build directorieswith all the intermediate files?Cache size for build directory (in MB)? [10]By default, each time the CPAN module is started, cache scanningis performed to keep the cache size in sync. To prevent from this,disable the cache scanning with 'never'.Perform cache scanning (atstart or never)? [atstart]To considerably speed up the initial CPAN shell startup, it ispossible to use Storable to create a cache of metadata. If Storableis not available, the normal index mechanism will be used.Cache metadata (yes/no)? [yes]The next option deals with the charset your terminal supports. Ingeneral CPAN is English speaking territory, thus the charset does notmatter much, but some of the aliens out there who upload theirsoftware to CPAN bear names that are outside the ASCII range. If yourterminal supports UTF-8, you say no to the next question, if itsupports ISO-8859-1 (also known as LATIN1) then you say yes, and if itsupports neither nor, your answer does not matter, you will not beable to read the names of some authors anyway. If you answer no, nameswill be output in UTF-8.Your terminal expects ISO-8859-1 (yes/no)? [yes]If you have one of the readline packages (Term::ReadLine::Perl,Term::ReadLine::Gnu, possibly others) installed, the interactive CPANshell will have history support. The next two questions deal with thefilename of the history file and with its size. If you do not want toset this variable, please hit SPACE RETURN to the following question.File to save your history? [/root/.cpan/histfile]Number of lines to save? [100]The CPAN module can detect when a module that which you are trying tobuild depends on prerequisites. If this happens, it can build theprerequisites for you automatically ('follow'), ask you forconfirmation ('ask'), or just ignore them ('ignore'). Please set yourpolicy to one of the three values.Policy on building prerequisites (follow, ask or ignore)? [ask]The CPAN module will need a few external programs to work properly.Please correct me, if I guess the wrong path for a program. Don'tpanic if you do not have some of them, just press ENTER for those. Todisable the use of a download program, you can type a space followedby ENTER.Where is your gzip program? [/bin/gzip]Where is your tar program? [/bin/tar]Where is your unzip program? [/usr/bin/unzip]Where is your make program? [/usr/bin/make]Where is your links program? [/usr/bin/links]Where is your wget program? [/usr/bin/wget]Warning: ncftpget not found in PATHWhere is your ncftpget program? []Warning: ncftp not found in PATHWhere is your ncftp program? []Where is your ftp program? [/usr/kerberos/bin/ftp]Where is your gpg program? [/usr/bin/gpg]What is your favorite pager program? [/usr/bin/less]What is your favorite shell? [/bin/bash]Every Makefile.PL is run by perl in a separate process. Likewise werun 'make' and 'make install' in processes. If you have anyparameters (e.g. PREFIX, LIB, UNINST or the like) you want to passto the calls, please specify them here.If you don't understand this question, just press ENTER.Parameters for the 'perl Makefile.PL' command?Typical frequently used settings:PREFIX=~/perl non-root users (please see manual for more hints)Your choice: []Parameters for the 'make' command?Typical frequently used setting:-j3 dual processor systemYour choice: []Parameters for the 'make install' command?Typical frequently used setting:UNINST=1 to always uninstall potentially conflicting filesYour choice: []Sometimes you may wish to leave the processes run by CPAN alonewithout caring about them. As sometimes the Makefile.PL containsquestion you're expected to answer, you can set a timer that willkill a 'perl Makefile.PL' process after the specified time in seconds.If you set this value to 0, these processes will wait forever. This isthe default and recommended setting.Timeout for inactivity during Makefile.PL? [0]If you're accessing the net via proxies, you can specify them in theCPAN configuration or via environment variables. The variable inthe $CPAN::Config takes precedence.Your ftp_proxy?Your http_proxy?Your no_proxy?You have no /root/.cpan/sources/MIRRORED.BYI'm trying to fetch oneLWP not availableCPAN: Net::FTP loaded okFetching with Net::FTP:ftp://ftp.perl.org/pub/CPAN/MIRRORED.BYNow we need to know where your favorite CPAN sites are located. Pusha few sites onto the array (just in case the first on the array won'twork). If you are mirroring CPAN to your local workstation, specify afile: URL.First, pick a nearby continent and country (you can pick several ofeach, separated by spaces, or none if you just want to keep yourexisting selections). Then, you will be presented with a list of URLsof CPAN mirrors in the countries you selected, along with previouslyselected URLs. Select some of those URLs, or just keep the old list.Finally, you will be prompted for any extra URLs -- file:, ftp:, orhttp: -- that host a CPAN mirror.(1) Africa(2) Asia(3) Central America(4) Europe(5) North America(6) Oceania(7) South AmericaSelect your continent (or several nearby continents) [] 2 ← Asiaを選んでいるSorry! since you don't have any existing picks, you must make ageographic selection.(1) Bangladesh(2) China(3) Hong Kong(4) India(5) Indonesia(6) Israel(7) Japan(8) Kazakhstan(9) Pakistan(10) Republic of Korea(11) Russia(12) Saudi Arabia(13) Singapore(14) Taiwan(15) Thailand(16) TurkeySelect your country (or several nearby countries) [] 7 ←さらに、Japanを選んでいるSorry! since you don't have any existing picks, you must make ageographic selection.(1) ftp://ftp.dti.ad.jp/pub/lang/CPAN/(2) ftp://ftp.jaist.ac.jp/pub/CPAN/(3) ftp://ftp.kddilabs.jp/CPAN/(4) ftp://ftp.nara.wide.ad.jp/pub/CPAN/(5) ftp://ftp.riken.jp/lang/CPAN/(6) ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/(7) ftp://ftp.u-aizu.ac.jp/pub/CPAN/(8) ftp://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/Select as many URLs as you like (by number),put them on one line, separated by blanks, e.g. '1 4 5' [] ●←1~8の中から好きなサーバを選択するEnter another URL or RETURN to quit: []New set of picks:ftp://ftp.riken.jp/lang/CPAN/commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pmTerminal does not support AddHistory.cpan shell -- CPAN exploration and modules installation (v1.7602)ReadLine support available (try 'install Bundle::CPAN')cpan>
これで完了。