LoginSignup
9
9

More than 5 years have passed since last update.

CentOS 6.2 でcpan install が失敗したときの対応

Last updated at Posted at 2013-06-11

Cent OS 6.2 でCPANを使ってモジュールをインストールしようとしたら、上手くいかなかったのでその対応メモ

バージョン確認
# cat /etc/issue
CentOS release 6.2 (Final)

#perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
CPANでモジュールインストール
cpan[1]> install Test::Simple
・・・
Can't locate Test/Harness.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/ExtUtils/Command/MM.pm line 50.

perlのバージョンが古いのかモジュールが壊れているのかわからないが、
perlのバージョンをあげてみることにする。

perlのソース(5.18)を入手
# wget http://www.cpan.org/src/5.0/perl-5.18.0.tar.gz
# tar zxvf perl-5.18.0.tar.gz
インストール

既存のperlとかぶると面倒なので、/usr/local/以下にインストールする

# cd perl-5.18.0
# ./configure.gnu –prefix=/usr/local/perl
# make
# make test
# make install
・・・
# ls /usr/local/perl
// perlがインストールされていることを確認
PATHの設定
# cd ~
# vi .bashrc
 //以下を追記
export PATH=/usr/local/perl/bin:$PATH
# . .bashrc
# perl -v
This is perl 5, version 18, subversion 0 (v5.18.0) built for x86_64-linux

perlを5.18上げてからcpan installすると、うまく動いた。

9
9
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9