【问题标题】:Perl cpan: error installing DateTime, CHECKSUM download failurePerl cpan:安装 DateTime 时出错,CHECKSUM 下载失败
【发布时间】:2013-06-16 18:25:44
【问题描述】:

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

perl -MCPAN -e 外壳 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

【问题讨论】:

  • 你有很多“连接被拒绝”。您可能在代理背后?

标签: perl cpan


【解决方案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 文件 解压 cd 到目录 做

  perl Build.PL
./Build install

perl Makefile.PL 
make install

相应地。

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

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

【讨论】:

  • 作为另一种选择,您可以使用 rpm 安装模块。我在 Debian 采用这种方法方面取得了很多成功,因为您可以免费获得更新和已在您的操作系统上测试过的版本
  • 谢谢,我尝试安装 DateTime,但还有其他依赖项,所以这就是为什么我们希望走 CPAN 路线来拉下一切。我尝试了 o conf ftp "" 和 o conf commit,但仍然出现错误。在与同事交谈后,我才意识到这里的 Linux 服务器可能与 Windows 机器不同的网络访问策略。我正在浏览 CPAN 网站上的常见问题解答,但没有看到网络
  • 您可以尝试使用 curl 以确保您可以从根目录获取文件。
  • 是的,我无法使用 curl 从 root 获取文件。我进行了手动安装,找出了 DateTime 的依赖关系并手动安装了一个一个,花了一个下午的时间。在我关于这种情况的另一篇文章stackoverflow.com/questions/17207800/… 中,其他人评论说改用 minicpan。
猜你喜欢
  • 1970-01-01
  • 2014-02-18
  • 1970-01-01
  • 2011-10-10
  • 2011-03-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-28
相关资源
最近更新 更多