我刚刚将Slackware64升级到14.1,并且在其中找到了Perl 5.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
在我的用户下运行时添加了该位置,而我Socket.pm
同时拥有/usr/local/lib64/perl5/
和的文件/usr/lib64/perl5
。
解决方法是按照3rensho的评论清除旧模块:
sudo rm -rf /usr/local/lib64/perl5/*
sudo rm -rf /usr/local/share/perl5/*
有用!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句