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

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**

你有什么主意吗 ?

谢谢 !

答案1

我认为问题在于:

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

您可以尝试使用 cpanm 而不是 cpan。它将尝试为您解决这些依赖性问题(大多数情况下都会成功)。

答案2

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

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

答案3

针对错误的确切解决方案:

CPAN::Meta::YAML 0.011 不可用

  1. 删除文件/usr/local/share/perl5/CPAN/Meta.pm
  2. 使用以下命令重新安装:

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

    或通过 CPAN。

答案4

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

相关内容