2012-02-22 144 views
0

我在上運行Solaris 10無法在Solaris 10上安裝perl CPAN模塊

我下載並安裝了perlsunfreeware

當我嘗試執行CPAN命令時,出現以下錯誤。

# perl -MCPAN -e shell 
Now you need to choose your CPAN mirror sites. You can let me 
pick mirrors for you, you can select them from a list or you 
can enter them by hand. 

Would you like me to automatically choose the best CPAN mirror 
sites for you? (This means connecting to the Internet and could 
take a couple minutes) [yes] 

Trying to fetch a mirror list from the Internet 
    LWP not available 
    LWP not available 
Fetching with Net::FTP: 
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY 
ld.so.1: perl: fatal: relocation error: file /usr/local/lib/perl5/5.12.3/i86pc-solaris/auto/Socket/Socket.so: symbol inet_aton: referenced symbol not found 
Killed 
# 

LDD似乎並不有問題

# ldd /usr/local/lib/perl5/5.12.3/i86pc-solaris/auto/Socket/Socket.so 
     libc.so.1 =>  /lib/libc.so.1 
     libm.so.2 =>  /lib/libm.so.2 

任何想法,我缺少的是什麼?

+3

這可能會幫助你http://stackoverflow.com/questions/3751656/why -cant-i-build-perl-modules-that-load-socket-so-on-solaris-10 – Ilion 2012-02-22 08:10:30

+0

謝謝。但是我經歷了這個解決方案之後仍然無法真正找出解決方案。這是否意味着我必須手動編譯模塊和它的依賴關係? – conandor 2012-02-22 09:27:42

回答

1

要避免一切的手動重新編譯,configure CPANmake_argLIBS=-lresolvmbuild_arg--config libs=-lresolv。 (這爲全部Perl發行版編譯運行添加了全局庫。)然後發出CPAN recompile命令。我沒有測試過這個。首先在備用系統上進行實驗,如果出現問題,可以恢復Perl樹。

如果你想只有插槽發行需要額外的庫參數,那麼最好是重新編譯手動此一:

$ cpan 
cpan> look Socket 
Socket$ perl Makefile.PL LIBS=-lresolv ; make ; make test 
Socket$ sudo make install 
+0

我認爲它應該是'LIBS = -lresolv'而不是'LIBS = -lresolve' – conandor 2012-02-23 08:31:06

+0

Typo修正了,謝謝。獲得更多的聲譽,然後你可以自己編輯東西。 :) – daxim 2012-02-23 10:01:23