2013-06-20 96 views
0

我在共享的Red Hat Linux 6.2服務器上運行Perl 5.10。我也問過機器的根用戶安裝的Perl模塊的日期時間對我來說,使用下面的命令:Perl cpan:安裝DateTime時出錯,CHECKSUM下載失敗

的perl -MCPAN -e殼 CPAN>安裝日期時間

我們能夠成功地安裝其他的Perl諸如Text :: CSV之前的模塊。

但安裝DateTime時發生以下錯誤。下面是錯誤日誌的最後位:

問:它看起來像錯誤可能會抱怨不能夠從ftp://ftp.perl.org/pub/CPAN/authors/id/R/RJ/RJBS獲取校驗和文件。但是,我沒有任何問題從我的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, [email protected] 
    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 

UPDATE1:

我們也嘗試鄰的conf FTP 「」 與鄰的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 
+0

你有很多「連接被拒絕」。你可能背後是代理嗎? – ikegami

回答

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文件下載到該目錄 做

perl Build.PL 
./Build install 

perl Makefile.PL 
make install 

相應。

這是所有CPAN會做,所以你會看到,如果你錯過任何包裝或模塊

順便說一下,如果你是幸福到別的地方安裝你的模塊,你並不需要root權限。有很多例子可以實現這個

+0

作爲另一種選擇,您可以使用rpm安裝模塊。我已經在Debian採取這種方法取得了很大的成功,因爲您可以免費獲得更新,並且已經在您的操作系統上測試過一個版本 – KeepCalmAndCarryOn

+0

謝謝,我試圖安裝DateTime,但也有其他依賴關係,所以我們希望去CPAN路線拉下一切。我嘗試了conf conf ftp「」和conf conf,並且我仍然收到錯誤信息。在與我的同事說話後,我意識到這裏的Linux服務器可能與Windows機器不同的網絡訪問策略。我正在瀏覽CPAN網站上的常見問題,並且我沒有看到網絡 – frank

+0

,您可以嘗試使用curl來確保您可以從根目錄獲取該文件。 – KeepCalmAndCarryOn