Perl/CPAN/CPAN環境を構築する
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* CAPN環境を構築する [#f10a6ae3]
本資料はCentOSを使用して、CPAN環境を構築しました。~
CentOS5, CentOS6ともに本資料の動作確認済みです。
#contents
#htmlinsertpcsp(ll-top.html,ll-sp.html)
* 開発環境がインストールされていない場合(CentOS限定) [#za...
CentOS6をMinimalでインストールした場合など、Perlすらイン...
以下のコマンドで開発ツール一式(開発関連パッケージ)をイン...
yum groupinstall 'Development tools'
本コマンドについては、以下の記事を参考にしてください。
-[[CentOSで開発ツールを一括でインストールする>http://linu...
CentOS6の場合は、インストール状態によってはCPANもインスト...
以下のコマンドでcpanをインストールします。
yum install cpan
* 関連記事 [#g9e27eb4]
-[[Net::SMTPモジュールをCPANを使いインストールする>Perl/C...
-[[MIME::EntityモジュールをCPANを使いインストールする>Per...
-[[CentOS/CentOSでWindowsのシフトJISファイル名を含むzipフ...
Archive::Zipを使用している例になります。
* CPANを起動する [#c0a77de9]
CPANを起動するには、以下のコマンドのいずれかを使用してく...
本コマンドは、rootで実行してください。~
(Ubuntuなどであれば、sudoコマンドを使用し以下のコマンドを...
cpan
または
perl -MCPAN -e shell
本資料では、以下cpanで起動した例を記します。
* Proxyを使用する場合 [#xbe88297]
proxyサーバを利用しなけらばならない場合は、cpanコマンドに...
以下にhttp_proxy, ftp_proxyの設定例を記します。
export http_proxy=http://proxy_server:8080/
export ftp_proxy=http://proxy_server:8080/
書式は以下のようになります。
export http_proxy=http[s]://プロキシサーバ:ポート番号/
export ftp_proxy=http[s]://プロキシサーバ:ポート番号/
* CPANコマンドを実行して設定を行う [#n0a4e26b]
基本的にはデフォルトのままで設定が完了できます。~
デフォルト値が[]内に表示されています。~
デフォルト値のままでよいのであれば、Enterキーを押します。
[root@centos5 ~]# cpan
We have to reconfigure CPAN.pm due to following uninitia...
cpan_home, keep_source_where, build_dir, build_cache, sc...
/usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.
CPAN is the world-wide archive of perl resources. It con...
100 sites that all replicate the same contents all aroun...
Many countries have at least one CPAN site already. The ...
found on CPAN are easily accessible with the CPAN.pm mod...
want to use CPAN.pm, you have to configure it properly.
If you do not want to enter a dialog now, you can answer...
question and I'll try to autoconfigure. (Note: you can r...
dialog anytime later by typing 'o conf init' at the cpan...
Are you ready for manual configuration? [yes]
当方はAsiaを選びました。
(1) Africa
(2) Asia
(3) Europe
(4) North America
(5) Oceania
(6) South America
Select your continent (or several nearby continents) []
日本を選びました。
(1) China
(2) India
(3) Indonesia
(4) Israel
(5) Japan
(6) Kazakhstan
(7) Pakistan
(8) Republic of Korea
(9) Saudi Arabia
(10) Singapore
(11) Taiwan
(12) Thailand
(13) Turkey
(14) Viet Nam
Select your country (or several nearby countries) []
ダウンロードするミラーが表示されるので使用するミラーを選...
(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' ...
Config.pmが設定されたメッセージが表示されcpanプロンプトが...
quit<Enter>を入力すればcpanプロンプトが終了します。
commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation ...
ReadLine support available (try 'install Bundle::CPAN')
cpan>
* cpanモジュールをインストールしてみる [#gabf29e5]
cpanコマンドを利用してArchive::Zipをインストールしてみま...
cpanに-iオプションをつけインストールしたいモジュールを入...
cpanコマンドについては、manコマンドなどで確認してみてくだ...
[root@centos5 ~]# cpan -i Archive::Zip
CPAN: Storable loaded ok
CPAN: LWP::UserAgent loaded ok
<snip>
途中、問い合わせがあります。基本的にはデフォルト値で大丈...
** エラーが発生した場合 [#obaaea14]
以下のようにCPANモジュールをインストール中にエラーが発生...
<snip>
Failed 12/15 test scripts, 20.00% okay. 13/13 subtests f...
make: *** [test_dynamic] エラー 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install witho...
このような場合は前述に記した''[[開発環境のパッケージ>]]''...
** インストール完了 [#daae35e0]
Archive::Zipのインストールが完了メッセージは以下の通りで...
<snip>
Installing /usr/share/man/man3/Archive::Zip.3pm
Installing /usr/bin/crc32
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-th...
Appending installation info to /usr/lib64/perl5/5.8.8/x8...
/usr/bin/make install -- OK
[root@centos5 ~]#
* 初期設定をクリアする(CPANの再設定方法) [#fae98fc0]
CPANの初期設定を削除する方法を記します。
** CPANプロンプトでCPAN初期設定をクリアする [#ya2eff6a]
以下のコマンドをCPANプロンプトが表示されている状態で入力...
設定変更の場合や設定ミスの場合、以下のコマンドでCPANの再...
o conf init
上記コマンドでは、CPANの初期化をし再度設定画面がすぐに表...
** Config.pmを削除する [#h22f27f4]
CentOSでしか確認していませんが、CPANの初期設定コマンドで...
- CentOS5.8
cpan> o conf init
/usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.
- CentOS6
/usr/share/perl5/CPAN/Config.pm
このファイルを削除することにより、CPANの設定が初期化され...
ちなみにConfig.pmには、以下のようになっています。
[root@centos5 ~]# cat /usr/lib/perl5/5.8.8/CPAN/Config.pm
# This is CPAN.pm's systemwide configuration file. This ...
# defaults for users, and the values can be changed in a...
# configuration file. The user-config file is being look...
# ~/.cpan/CPAN/MyConfig.pm.
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/root/.cpan/build],
'cache_metadata' => q[1],
'cpan_home' => q[/root/.cpan],
'ftp' => q[/usr/kerberos/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gpg' => q[/usr/bin/gpg],
'gzip' => q[/bin/gzip],
'histfile' => q[/root/.cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/root/.cpan/sources],
'links' => q[/usr/bin/links],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[],
'ncftp' => q[],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'prerequisites_policy' => q[ask],
'scan_cache' => q[atstart],
'shell' => q[/bin/bash],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'unzip' => q[/usr/bin/unzip],
'urllist' => [],
'wget' => q[/usr/bin/wget],
};
1;
__END__
#htmlinsertpcsp(ll-btm.html,ll-sp.html)
終了行:
#navi(../)
* CAPN環境を構築する [#f10a6ae3]
本資料はCentOSを使用して、CPAN環境を構築しました。~
CentOS5, CentOS6ともに本資料の動作確認済みです。
#contents
#htmlinsertpcsp(ll-top.html,ll-sp.html)
* 開発環境がインストールされていない場合(CentOS限定) [#za...
CentOS6をMinimalでインストールした場合など、Perlすらイン...
以下のコマンドで開発ツール一式(開発関連パッケージ)をイン...
yum groupinstall 'Development tools'
本コマンドについては、以下の記事を参考にしてください。
-[[CentOSで開発ツールを一括でインストールする>http://linu...
CentOS6の場合は、インストール状態によってはCPANもインスト...
以下のコマンドでcpanをインストールします。
yum install cpan
* 関連記事 [#g9e27eb4]
-[[Net::SMTPモジュールをCPANを使いインストールする>Perl/C...
-[[MIME::EntityモジュールをCPANを使いインストールする>Per...
-[[CentOS/CentOSでWindowsのシフトJISファイル名を含むzipフ...
Archive::Zipを使用している例になります。
* CPANを起動する [#c0a77de9]
CPANを起動するには、以下のコマンドのいずれかを使用してく...
本コマンドは、rootで実行してください。~
(Ubuntuなどであれば、sudoコマンドを使用し以下のコマンドを...
cpan
または
perl -MCPAN -e shell
本資料では、以下cpanで起動した例を記します。
* Proxyを使用する場合 [#xbe88297]
proxyサーバを利用しなけらばならない場合は、cpanコマンドに...
以下にhttp_proxy, ftp_proxyの設定例を記します。
export http_proxy=http://proxy_server:8080/
export ftp_proxy=http://proxy_server:8080/
書式は以下のようになります。
export http_proxy=http[s]://プロキシサーバ:ポート番号/
export ftp_proxy=http[s]://プロキシサーバ:ポート番号/
* CPANコマンドを実行して設定を行う [#n0a4e26b]
基本的にはデフォルトのままで設定が完了できます。~
デフォルト値が[]内に表示されています。~
デフォルト値のままでよいのであれば、Enterキーを押します。
[root@centos5 ~]# cpan
We have to reconfigure CPAN.pm due to following uninitia...
cpan_home, keep_source_where, build_dir, build_cache, sc...
/usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.
CPAN is the world-wide archive of perl resources. It con...
100 sites that all replicate the same contents all aroun...
Many countries have at least one CPAN site already. The ...
found on CPAN are easily accessible with the CPAN.pm mod...
want to use CPAN.pm, you have to configure it properly.
If you do not want to enter a dialog now, you can answer...
question and I'll try to autoconfigure. (Note: you can r...
dialog anytime later by typing 'o conf init' at the cpan...
Are you ready for manual configuration? [yes]
当方はAsiaを選びました。
(1) Africa
(2) Asia
(3) Europe
(4) North America
(5) Oceania
(6) South America
Select your continent (or several nearby continents) []
日本を選びました。
(1) China
(2) India
(3) Indonesia
(4) Israel
(5) Japan
(6) Kazakhstan
(7) Pakistan
(8) Republic of Korea
(9) Saudi Arabia
(10) Singapore
(11) Taiwan
(12) Thailand
(13) Turkey
(14) Viet Nam
Select your country (or several nearby countries) []
ダウンロードするミラーが表示されるので使用するミラーを選...
(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' ...
Config.pmが設定されたメッセージが表示されcpanプロンプトが...
quit<Enter>を入力すればcpanプロンプトが終了します。
commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation ...
ReadLine support available (try 'install Bundle::CPAN')
cpan>
* cpanモジュールをインストールしてみる [#gabf29e5]
cpanコマンドを利用してArchive::Zipをインストールしてみま...
cpanに-iオプションをつけインストールしたいモジュールを入...
cpanコマンドについては、manコマンドなどで確認してみてくだ...
[root@centos5 ~]# cpan -i Archive::Zip
CPAN: Storable loaded ok
CPAN: LWP::UserAgent loaded ok
<snip>
途中、問い合わせがあります。基本的にはデフォルト値で大丈...
** エラーが発生した場合 [#obaaea14]
以下のようにCPANモジュールをインストール中にエラーが発生...
<snip>
Failed 12/15 test scripts, 20.00% okay. 13/13 subtests f...
make: *** [test_dynamic] エラー 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install witho...
このような場合は前述に記した''[[開発環境のパッケージ>]]''...
** インストール完了 [#daae35e0]
Archive::Zipのインストールが完了メッセージは以下の通りで...
<snip>
Installing /usr/share/man/man3/Archive::Zip.3pm
Installing /usr/bin/crc32
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-th...
Appending installation info to /usr/lib64/perl5/5.8.8/x8...
/usr/bin/make install -- OK
[root@centos5 ~]#
* 初期設定をクリアする(CPANの再設定方法) [#fae98fc0]
CPANの初期設定を削除する方法を記します。
** CPANプロンプトでCPAN初期設定をクリアする [#ya2eff6a]
以下のコマンドをCPANプロンプトが表示されている状態で入力...
設定変更の場合や設定ミスの場合、以下のコマンドでCPANの再...
o conf init
上記コマンドでは、CPANの初期化をし再度設定画面がすぐに表...
** Config.pmを削除する [#h22f27f4]
CentOSでしか確認していませんが、CPANの初期設定コマンドで...
- CentOS5.8
cpan> o conf init
/usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.
- CentOS6
/usr/share/perl5/CPAN/Config.pm
このファイルを削除することにより、CPANの設定が初期化され...
ちなみにConfig.pmには、以下のようになっています。
[root@centos5 ~]# cat /usr/lib/perl5/5.8.8/CPAN/Config.pm
# This is CPAN.pm's systemwide configuration file. This ...
# defaults for users, and the values can be changed in a...
# configuration file. The user-config file is being look...
# ~/.cpan/CPAN/MyConfig.pm.
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/root/.cpan/build],
'cache_metadata' => q[1],
'cpan_home' => q[/root/.cpan],
'ftp' => q[/usr/kerberos/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gpg' => q[/usr/bin/gpg],
'gzip' => q[/bin/gzip],
'histfile' => q[/root/.cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/root/.cpan/sources],
'links' => q[/usr/bin/links],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[],
'ncftp' => q[],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'prerequisites_policy' => q[ask],
'scan_cache' => q[atstart],
'shell' => q[/bin/bash],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'unzip' => q[/usr/bin/unzip],
'urllist' => [],
'wget' => q[/usr/bin/wget],
};
1;
__END__
#htmlinsertpcsp(ll-btm.html,ll-sp.html)
ページ名: