RedHat – 无法安装Perl模块(CPAN)

我无法安装perl模块:

[root@xxx]# cpan Module::Find [...] CPAN: File::Temp loaded ok (v0.22) CPAN.pm: Going to build C/CR/CRENZ/Module-Find-0.12.tar.gz Checking if your kit is complete... Looks good CPAN::Meta::YAML 0.011 is not available at /usr/local/share/perl5/CPAN/Meta.pm line 613 Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site] CRENZ/Module-Find-0.12.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install 

如果我从控制台(CPAN)尝试:

 Checking if your kit is complete... Looks good CPAN::Meta::YAML 0.011 is not available at /usr/local/share/perl5/CPAN/Meta.pm line 613 Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site] CRENZ/Module-Find-0.12.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Failed during this command: CRENZ/Module-Find-0.12.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL INSTALLDIRS=site' **returned status 512** 

你有什么主意吗 ?

谢谢 !

我认为问题是:

 CPAN::Meta::YAML 0.011 is not available at /usr/local/share/perl5/CPAN/Meta.pm line 613 

你可以用cpanm来代替cpan。 它会尽力为你解决这些依赖性问题(主要是成功的)。

最好的方法是从包存储库安装这个包,而不是通过CPAN:

 yum install -y "perl(Module::Find)" 

正确的解决scheme的错误:

CPAN :: Meta :: YAML 0.011不可用

  1. 删除文件/usr/local/share/perl5/CPAN/Meta.pm
  2. 重新安装它:

     yum install -y "perl(CPAN::Meta::YAML)" 

    或通过CPAN。

这个问题已经通过删除文件/usr/local/share/perl5/CPAN/Meta.pm解决了。