通过CPAN安装Perl模块时,似乎出现配置问题,我不知道如何纠正它:

[root@ip JESSE]# pwd
/root/.cpan/sources/authors/id/J/JE/JESSE

[root@ip JESSE]# ls -l
total 240
-rw-r--r-- 1 root root 105464 Feb 20 11:39 CHECKSUMS
-rw-r--r-- 1 root root   9223 Apr 12  2011 Locale-Maketext-Simple-0.21.tar.gz
-rw-r--r-- 1 root root 125483 Feb 20 11:39 WWW-Mechanize-1.72.tar.gz

[root@ip JESSE]# cpan -i WWW::Mechanize
CPAN: Storable loaded ok (v2.20)
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 20 Feb 2012 11:10:26 GMT
Running install for module 'WWW::Mechanize'
Running make for J/JE/JESSE/WWW-Mechanize-1.72.tar.gz
CPAN: Digest::SHA loaded ok (v5.61)
CPAN: Compress::Zlib loaded ok (v2.033)
Checksum for /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.82)
Uncompressed /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz successfully
Using Tar:/bin/tar xvf "WWW-Mechanize-1.72.tar":
Couldn't untar WWW-Mechanize-1.72.tar
CPAN: File::Temp loaded ok (v0.22)
CPAN: CPAN::Meta loaded ok (v2.112150)
Package seems to come without Makefile.PL.
  (The test -f "/root/.cpan/build/JESSE-n72IRU/Makefile.PL" returned false.)
  Writing one on our own (setting NAME to WWWMechanize)
  Had problems unarchiving. Please build manually
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install

[root@ip JESSE]# ls -l
total 240
-rw-r--r-- 1 root root 105464 Feb 20 11:39 CHECKSUMS
-rw-r--r-- 1 root root   9223 Apr 12  2011 Locale-Maketext-Simple-0.21.tar.gz
-rw-r--r-- 1 root root 125483 Feb 20 11:39 WWW-Mechanize-1.72.tar.gz

[root@ip JESSE]# which tar
/bin/tar

[root@ip JESSE]# which gzip
/bin/gzip

问题似乎在这里:
Uncompressed /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz successfully
Using Tar:/bin/tar xvf "WWW-Mechanize-1.72.tar":
Couldn't untar WWW-Mechanize-1.72.tar

tar.gz文件确实未经压缩,可以在新目录中找到:
/root/.cpan/build/JESSE-KjCEMS/WWW-Mechanize-1.72.tar

如果我从 shell 程序内部运行相同的命令,则会得到更多信息:
cpan[1]> install WWW::Mechanize
CPAN: Storable loaded ok (v2.20)
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 20 Feb 2012 11:10:26 GMT
Running install for module 'WWW::Mechanize'
Running make for J/JE/JESSE/WWW-Mechanize-1.72.tar.gz
CPAN: Digest::SHA loaded ok (v5.61)
CPAN: Compress::Zlib loaded ok (v2.033)
Checksum for /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz ok
Scanning cache /root/.cpan/build for sizes
Use of uninitialized value $newdir in substitution (s///) at /usr/lib64/perl5/Cwd.pm line 502.
Use of uninitialized value $newdir in chdir at /usr/lib64/perl5/Cwd.pm line 510.
Use of chdir('') or chdir(undef) as chdir() is deprecated at /usr/lib64/perl5/Cwd.pm line 510.
Use of uninitialized value $newdir in pattern match (m//) at /usr/lib64/perl5/Cwd.pm line 525.
Use of uninitialized value $newdir in split at /usr/lib64/perl5/Cwd.pm line 531.
..........................................................................--DONE
DEL(1/10): /root/.cpan/build/CPAN-1.9600-jGTV10
DEL(2/10): /root/.cpan/build/File-Which-1.09-yoVWZC
DEL(3/10): /root/.cpan/build/Test-Script-1.07-aJWrXb
DEL(4/10): /root/.cpan/build/Probe-Perl-0.01-gzZ2eR
DEL(5/10): /root/.cpan/build/IPC-Run3-0.044-AP6EMp
DEL(6/10): /root/.cpan/build/Time-HiRes-1.9721-xxseE6
DEL(7/10): /root/.cpan/build/CPAN-Meta-YAML-0.003-wGtH0a
DEL(8/10): /root/.cpan/build/JSON-PP-2.27105-fvkwNa
DEL(9/10): /root/.cpan/build/Package-Constants-0.02-7Ms_OL
DEL(10/10): /root/.cpan/build/Module-Metadata-1.000004-tXKIBB
CPAN: Archive::Tar loaded ok (v1.82)
Uncompressed /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz successfully
Using Tar:/bin/tar xvf "WWW-Mechanize-1.72.tar":
Couldn't untar WWW-Mechanize-1.72.tar
CPAN: File::Temp loaded ok (v0.22)
CPAN: CPAN::Meta loaded ok (v2.112150)
Package seems to come without Makefile.PL.
  (The test -f "/root/.cpan/build/JESSE-DGrTh_/Makefile.PL" returned false.)
  Writing one on our own (setting NAME to WWWMechanize)
  Had problems unarchiving. Please build manually
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
Failed during this command:
 JESSE/WWW-Mechanize-1.72.tar.gz              : unwrapped NO -- untar failed

在我看来,$ newdir不会使用动态生成的/root/.cpan/build/JESSE-DGrTh_//root/.cpan/build/JESSE-KjCEMS/或系统生成的任何内容进行更新,或者至少信息没有到达tar命令

有谁知道我可以在无需手动安装的情况下修复该机制?

最佳答案

编辑:

我又遇到了这个问题。我所需要做的就是释放一些内存,如Keith Broughton建议的那样。

我遇到了同样的问题,并试图找到此问题的根本原因。我在这里列出我的发现,因此其他Google员工不必花几个小时就可以放弃...

为我解决的只是简单地重新启动系统

我尝试过的事情:

  • 升级CPAN。这也将失败,并显示“无法解压缩”错误消息。不管您使用cpan shell,“cpan -i CPAN”还是“perl -MCPAN -e'install CPAN'”进行尝试,都没有关系。我认为这些方法都不能解决问题,但是当您开始使用Google搜索时,建议将所有这些方法作为可能的解决方案。
  • 用记录日志其输入的脚本替换tar,以检查调用时参数或cwd之一是否不正确。似乎从未调用过该脚本。即使暂时重命名/bin/tar,“无法解压缩”消息仍然相同。
  • 检查CPAN/Tarzip.pm,并在写“无法解压”消息的代码附近添加打印行。似乎system()调用失败,并且从未调用过tar(或我的调试代码中的ls)。

  • 然后我决定重新启动,这是一个选择,因为这不是实时系统。此后,问题消失了,并且第一次尝试安装了Perl模块。

    其他观察:
  • 该系统似乎可以正常工作。您仍然可以连接到系统,可以编辑文件,重新启动后仍可以进行修改。我希望其中任何一个在Perl system()调用开始失败之前都会失败很长时间。
  • 快速浏览日志文件不会显示任何红色标记。
  • 关于perl - CPAN Perl模块安装程序找不到tar文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9363372/

    10-11 20:57