如何修复这个损坏的 CPAN 和 Perl 安装

如何修复这个损坏的 CPAN 和 Perl 安装

我的 Perl 和 cpan 安装已损坏。 Perl 版本如下所示,该命令执行并运行良好。

>perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 34 registered patches, see perl -V for more detail)

但是,当我尝试运行 cpan 以安装 perl 模块时,cpan 返回此错误,

> cpan
Fcntl object version 1.11 does not match $Fcntl::VERSION 1.13 at /usr/lib64/perl5/DynaLoader.pm line 213.
Compilation failed in require at /usr/share/perl5/CPAN/FTP.pm line 6.
BEGIN failed--compilation aborted at /usr/share/perl5/CPAN/FTP.pm line 6.
Compilation failed in require at /usr/share/perl5/CPAN.pm line 27.
BEGIN failed--compilation aborted at /usr/share/perl5/CPAN.pm line 27.
Compilation failed in require at /usr/share/perl5/App/Cpan.pm line 183.
BEGIN failed--compilation aborted at /usr/share/perl5/App/Cpan.pm line 183.
Compilation failed in require at /usr/bin/cpan line 8.
BEGIN failed--compilation aborted at /usr/bin/cpan line 8.

当我再次运行 shell 版本的 CPAN 时,我得到了同样的错误。 Dynaloader.pm 版本似乎与以前安装的版本有一些冲突

version or something. 

> sudo perl -MCPAN -e shell
    Fcntl object version 1.11 does not match $Fcntl::VERSION 1.13 at /usr/lib64/perl5/DynaLoader.pm line 213.
    Compilation failed in require at /usr/share/perl5/CPAN/FTP.pm line 6.
    BEGIN failed--compilation aborted at /usr/share/perl5/CPAN/FTP.pm line 6.
    Compilation failed in require at /usr/share/perl5/CPAN.pm line 27.
    BEGIN failed--compilation aborted at /usr/share/perl5/CPAN.pm line 27.
    Compilation failed in require.
    BEGIN failed--compilation aborted.


> perl -V
Can't undef active subroutine at /usr/local/lib64/perl5/Config_heavy.pl line 1418.
Compilation failed in require at /usr/lib64/perl5/Config.pm line 79.
  1. 如何解决动态加载冲突和错误?
  2. 为什么 perl -V 返回编译失败错误?
  3. 这些错误是否意味着 perl 安装已损坏?

谢谢。

相关内容