0

我在共享的 Red Hat Linux 6.2 服务器上运行 Perl 5.10。我已经要求机器的 root 用户使用以下命令为我安装 Perl DateTime 模块:

perl -MCPAN -e shell cpan> 安装日期时间

我们之前能够成功安装其他 Perl 模块,例如 Text::CSV。

但是在安装 DateTime 时出现以下错误。这是错误日志的最后一位:

问题:看起来错误可能是抱怨无法从 ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS获取 CHECKSUM 文件。但是,我从 Internet Explorer 浏览到这个确切的文件没有问题。有人可以建议解决此问题的方法吗?谢谢。

Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/id/R/RJ/RJBS/CHECKSUMS.tmp12173" to get
    "ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS.gz"
    --2013-06-20 09:30:06--  ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS.gz
           => b/root/.cpan/sources/authors/id/R/RJ/RJBS/CHECKSUMS.tmp12173b
Resolving ftp.perl.org... 203.178.137.175, 163.143.1.21 Connecting to ftp.perl.org|203.178.137.175|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/CPAN/authors/id/R/RJ/RJBS ... done.
==> SIZE CHECKSUMS.gz ... done.
==> PASV ... done.    ==> RETR CHECKSUMS.gz ... 
No such file bCHECKSUMS.gzb.

Warning: no success downloading '/root/.cpan/sources/authors/id/R/RJ/RJBS/CHECKSUMS.tmp12173'. Giving up on it. at /usr/share/perl5/CPAN/Distribution.pm line
1311

As a last resort we now switch to the external ftp command '/usr/kerberos/bin/ftp'
to get '/root/.cpan/sources/authors/id/R/RJ/RJBS/CHECKSUMS.tmp12173'.

Doing so often leads to problems that are hard to diagnose.

If you're the victim of such problems, please consider unsetting the ftp config variable with

    o conf ftp ""
    o conf commit

Issuing "/usr/kerberos/bin/ftp -n"

  Trying with external ftp to get
    ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS
  Going to send the dialog
    open ftp.perl.org
    user anonymous Red Hat, Inc.@localhost.localdomain
    lcd /root/.cpan/sources/authors/id/R/RJ/RJBS
    cd /
    cd pub
    cd CPAN
    cd authors
    cd id
    cd R
    cd RJ
    cd RJBS
    bin
    get CHECKSUMS CHECKSUMS.tmp12173
    quit

Not connected.
Local directory now /root/.cpan/sources/authors/id/R/RJ/RJBS
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Not connected.
Bad luck... Still failed!
Can't access URL ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS.

Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'

Could not fetch authors/id/R/RJ/RJBS/CHECKSUMS

更新1:

我们还尝试了 o conf ftp "" 和 o conf commit 命令,但仍然出现错误。

Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/id/R/RJ/RJBS/CHECKSUMS.tmp16529" to get
    "http://www.perl.org/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS.gz"
    --2013-06-20 13:52:07--  http://www.perl.org/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS.gz
Resolving www.perl.org... 207.171.7.41, 207.171.7.51 Connecting to www.perl.org|207.171.7.41|:80... failed: Connection refused.
Connecting to www.perl.org|207.171.7.51|:80... failed: Connection refused.
Warning: no success downloading '/root/.cpan/sources/authors/id/R/RJ/RJBS/CHECKSUMS.tmp16529'. Giving up on it. at /usr/share/perl5/CPAN/Distribution.pm line
1311
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/R/RJ/RJBS/Test-Fatal-0.010.tar.gz ok Test-Fatal-0.010 Test-Fatal-0.010/README Test-Fatal-0.010/Changes Test-Fatal-0.010/LICENSE Test-Fatal-0.010/dist.ini Test-Fatal-0.010/META.yml Test-Fatal-0.010/MANIFEST Test-Fatal-0.010/t Test-Fatal-0.010/t/basic.t Test-Fatal-0.010/META.json Test-Fatal-0.010/Makefile.PL Test-Fatal-0.010/lib/Test Test-Fatal-0.010/lib/Test/Fatal.pm
Test-Fatal-0.010/t/like-exception.t
Test-Fatal-0.010/t/release-pod-syntax.t

  CPAN.pm: Going to build R/RJ/RJBS/Test-Fatal-0.010.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Try::Tiny 0.07 not found.
Writing Makefile for Test::Fatal
Could not read '/root/.cpan/build/Test-Fatal-0.010-GNYnPy/META.yml'. Falling back to other methods to determine prerequisites
---- Unsatisfied dependencies detected during ----
----       RJBS/Test-Fatal-0.010.tar.gz       ----
    Try::Tiny [requires]
Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module 'Try::Tiny'
'YAML' not installed, falling back to Data::Dumper and Storable to read prefs '/root/.cpan/prefs'
Running make for D/DO/DOY/Try-Tiny-0.12.tar.gz Fetching with LWP:
  http://www.perl.org/CPAN/authors/id/D/DO/DOY/Try-Tiny-0.12.tar.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (connect: Connection refused)] Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/authors/id/D/DO/DOY/Try-Tiny-0.12.tar.gz
LWP failed with code[500] message[]
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/authors/id/D/DO/DOY/Try-Tiny-0.12.tar.gz
Catching error: "Timeout at /usr/share/perl5/Net/FTP.pm line 491\cJ" at /usr/share/perl5/CPAN.pm line 391
        CPAN::shell() called at -e line 1
4

1 回答 1

1

你按照它的建议做了吗?

If you're the victim of such problems, please consider unsetting the ftp config variable with

o conf ftp ""
o conf commit

或者,您可以从 cpan 站点以 gz 文件的形式下载模块,将其解压缩到目录 do

  perl Build.PL
./Build install

或者

perl Makefile.PL 
make install

因此。

这就是 cpan 将要做的所有事情,因此您将查看是否缺少任何包或模块

顺便说一句,如果您愿意将模块安装在其他地方,则无需成为 root。有很多例子可以实现这一点

于 2013-06-20T03:15:46.330 回答