我刚刚将Slackware64升级到14.1,并在其中找到Perl5.18。Socket.pm现在抱怨它是为另一个Perl版本编译的,这个版本是5.16。以下是错误:
Perl API version v5.16.0 of Socket does not match v5.18.0 at /usr/share/perl5/XSLoader.pm line 92.不幸的是,即使使用Socket.pm,我也无法重新安装cpan。
$ cpan Socket
Reading '/home/francesco-salix/.cpan/Metadata'
Database was generated on Tue, 26 Nov 2013 09:08:12 GMT
Running install for module 'Socket'
Running make for P/PE/PEVANS/Socket-2.013.tar.gz
Checksum for /home/francesco-salix/.cpan/sources/authors/id/P/PE/PEVANS/Socket-2.013.tar.gz ok
CPAN.pm: Building P/PE/PEVANS/Socket-2.013.tar.gz
Attempt to reload Socket.pm aborted.
Compilation failed in require at /usr/share/perl5/IPC/Cmd.pm line 46.
BEGIN failed--compilation aborted at /usr/share/perl5/IPC/Cmd.pm line 46.
Compilation failed in require at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 11.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 11.
Compilation failed in require at /usr/share/perl5/ExtUtils/CBuilder/Platform/Unix.pm line 4.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/CBuilder/Platform/Unix.pm line 4.
Compilation failed in require at (eval 6) line 2.
BEGIN failed--compilation aborted at (eval 6) line 2.
Compilation failed in require at Makefile.PL line 19.
Warning: No success on command[/usr/bin/perl5.18.1 Makefile.PL]
'YAML' not installed, will not store persistent state
PEVANS/Socket-2.013.tar.gz
/usr/bin/perl5.18.1 Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites据我所知,Socket.pm是一个Perl核心模块。所以,我认为它应该与Perl一起升级。
下面是当前在@INC中的目录
$ perl -E'say for @INC'
/home/francesco-salix/perl5/lib/perl5/x86_64-linux-thread-multi
/home/francesco-salix/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.我看到一些文件夹看起来是重复的,但我不知道它们是否应该是那样的。但是,在前两条路径中没有Socket.pm (假设cpan在我的用户下运行时添加了这个路径,同时为/usr/local/lib64/perl5/和/usr/lib64/perl5提供了一个Socket.pm文件)。
发布于 2013-12-19 04:05:55
解决方案是清除旧模块,遵循3 3rensho的评论
sudo rm -rf /usr/local/lib64/perl5/*
sudo rm -rf /usr/local/share/perl5/*它起作用了!
https://stackoverflow.com/questions/20213527
复制相似问题