help: Perl CPAN安装报错[已经解决]

help: Perl CPAN安装报错[已经解决]

操作系统: CentOS 5.1 x64
Perl版本: 5.8.8
Perl CPAN路径: /usr/lib/perl5/5.8.8/CPAN
已经删除Config.pm并重新设定源为日本的源,确认服务器可以连接该服务器,按照google上的说法先install Bundle::CPAN
shell> perl -MCPAN -e shell
cpan> install Bundle::CPAN
然后就报错
cpan> install Bundle::LWP
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Warning: Found only 0 objects in /root/.cpan/Metadata
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 20) line 1.
at /usr/lib/perl5/5.8.8/CPAN.pm line 3405
        CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/lib/perl5/5.8.8/CPAN.pm line 3128
        CPAN::Index::reload('CPAN::Index') called at /usr/lib/perl5/5.8.8/CPAN.pm line 785
        CPAN::instance('CPAN=HASH(0x195bbef0)', 'CPAN::Bundle', 'Bundle::ApacheTest') called at /usr/lib/perl5/5.8.8/CPAN.pm line 1427
        CPAN::Shell::local_bundles('CPAN::Shell') called at /usr/lib/perl5/5.8.8/CPAN.pm line 1835
        CPAN::Shell::expandany('CPAN::Shell', 'Bundle::LWP') called at /usr/lib/perl5/5.8.8/CPAN.pm line 2077
        CPAN::Shell::rematein('CPAN::Shell', 'install', 'Bundle::LWP') called at /usr/lib/perl5/5.8.8/CPAN.pm line 2164
        CPAN::Shell::install('CPAN::Shell', 'Bundle::LWP


之前连接的是linuxforum的源,但是同样报这个错误

不知道是什么原因?

Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 20) line 1.

检查 CPAN::Modulelist 有没有安装..没有的话..用tarball安装...


QUOTE:
原帖由 apile 于 2008-5-14 13:10 发表
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 20) line 1.

检查 CPAN::Modulelist 有没有安装..没有的话..用tarball安装...

感谢您的回复
问题已经解决

原因是默认缓存/root/.cpan中的数据损坏
rm -rf ~/.cpan
删除后在perl -MCPAN -e shell中执行reload index
然后执行install Bundle::CPAN
最后执行reload CPAN即可正常通过命令行install MODULES