CPAN Perl模块安装程序找不到tar文件

时间:2012-02-20 15:12:05

标签: perl module install cpan

通过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命令

有没有人知道如何在不必手动安装的情况下修复机制?

5 个答案:

答案 0 :(得分:12)

编辑:

我又遇到了这个问题。我需要做的就是像Keith Broughton所说的那样释放一些记忆。


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

为我解决的问题只是重新启动系统

我尝试的事情:

  • 升级CPAN。这也会因“无法解压”错误消息而失败。如果你尝试使用cpan shell,“cpan -i CPAN”或“perl -MCPAN -e'安装CPAN'”,我无所谓。我认为其中任何一个都不会解决问题,但是当你开始谷歌搜索所有这些都被建议作为可能的解决方案。
  • 使用记录其输入的脚本替换tar,以检查其中一个参数或cwd在调用时是否不正确。似乎从未调用过脚本。即使在暂时重命名/ bin / tar之后,“无法解压”消息仍然相同。
  • 检查CPAN / Tarzip.pm并在写入“无法解压”消息的代码附近添加打印行。似乎system()调用失败,并且从不调用tar(或我的调试代码中的ls)。

然后我决定重新启动,这是一个选项,因为这不是一个实时系统。之后问题就消失了,首先尝试安装Perl模块。

其他观察:

  • 系统似乎对其余部分效果很好。您仍然可以连接到系统,您可以编辑文件,重启后仍然存在修改。我希望在Perl system()调用开始失败之前很久就会失败。
  • 快速浏览日志文件时不会显示任何红色标记。

答案 1 :(得分:8)

有时这可能仅仅因为缺乏可用内存而发生。尝试关闭一些正在运行的服务,然后重试。

为我工作: - )

答案 2 :(得分:3)

解决以下错误:

Couldn't untar WWW-Mechanize-1.72.tar

尝试安装Archive::Tar

关于centos 6.X:

yum install perl-Archive-Tar.x86_64

答案 3 :(得分:3)

在运行Ubuntu的512MB RAM(大约200MB免费)的DigitalOcean Droplet上发现了同样的问题。

我能够通过重启机器解决它,我尝试使用'安装Bundle :: CPAN'来更新我的CPAN。它适用于前几个模块,然后“无法解开”模块。消息再次出现。

重新启动允许我进行安装。这些重复的重新启动当然不是最佳解决方案。

鉴于系统具有可用内存,并且在使用机器一段时间后问题再次出现,似乎这可能与共享库的问题有关。

答案 4 :(得分:0)

以蓝色拍摄:分区已满。删除一些文件。