2013-11-26 86 views
0

我剛將Slackware64升級到14.1,並在其中找到了Perl 5.18。 Socket.pm現在抱怨說它是爲另一個Perl版本編譯的,它是5.16。以下是錯誤:升級後無法加載(並重新安裝)Socket.pm

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

回答

2

Socket.pm的確是一個核心模塊。而的CPAN.pm模塊的ExtUtils :: MakeMaker的使用它(通過IPC :: CMD),所以如果Socket.pm壞了, CPAN.pm Makefile.PL也將被打破。

鑑於它是一個核心模塊,並且已經安裝了Perl,這表明Perl正試圖從其他一些較舊的路徑加載Socket.pm。下面將告訴你Perl在哪裏ying加載模塊:

perl -E'say for @INC' 

有沒有什麼可疑的地方。它可能會找到爲Perl 5.16編譯的舊模塊的任何地方?

+0

@tobyinc,你可能是對的。看我的編輯。你可以發佈你現有的@ INC嗎? – Zagorax

+0

根據'pkgtools','perl'軟件包引用'/ usr/lib64/perl5'中的文件,所以我假設'/ usr/local/lib64/perl5'指的是舊文件,在升級過程中並未刪除。如何修復包含路徑? – Zagorax

+0

我不在Slackware上,所以我的@INC不太可能對您有所幫助。我同意ikegami,你的主目錄中的路徑最有可能是有問題的路徑。我會開始擦洗這些。 – tobyink

0

解決的辦法是清除舊的模塊,下面3rensho’s comment

sudo rm -rf /usr/local/lib64/perl5/* 
sudo rm -rf /usr/local/share/perl5/* 

它的工作原理!

相關問題