這是我們一獨立主機用戶,在perl裡安裝module所發生的問題。
其中查資料過程比較煩瑣,不在額外描述,這邊直接提供解法。
如何發生?
當在 perl 裡要安裝module,總會跳出 Cannot unzip, no unzip program available 這個錯誤訊息,導致module安裝中斷。
為什麼會發生這個問題?
這是因為安裝好cenotos,如果裡面沒有安裝unzip,就去安裝perl,
就會導致perl的設定檔裡沒有取得unzip使用路逕,
自然在perl安裝模組,就會遇到解壓縮的問題。
如何解決?!
解決方式有兩種,但都要先在linux shell裡安裝好unzip:
1.安裝好unzip後,在將perl重新移除在安裝。
2.修改perl的 Config.pm檔,並將
這一行 ‘unzip’ => q[] and change it to
改為 ‘unzip’ => q[/usr/bin/unzip]
這樣就可以順利安裝perl module
(本篇教學由unethost.com客服撰寫)
延伸閱讀:如何備份Cpanel後台安裝的套裝程式?
安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。
(1) 先檢查,現在系統裝了那些perl的模組:
先打指令instmodsh,再打l,這樣就會列出系統中的perl modules了。
[root@proxy vhost]# instmodsh
Available commands are:
l – List all installed modules
m <module> – Select a module
q – Quit the program
cmd? l
Installed modules are:
Class::Loader
Crypt::Random
Digest::SHA
Digest::SHA::PurePerl
IPC::SysV
Math::Pari
Net::IP::Match::Regexp
Perl
(2) 來安裝模組吧:
A) 首先啟動 CPAN Shell:
# perl -MCPAN -e shell
B) 在CPAN Shell的環境下,安裝 perl module,以模組IPC::SharedMem為例子
# cpan> install IPC::SharedMem
參考資料:
(1) http://www.cyberciti.biz/faq/how-do-i-find-out-what-perl-modules-already-installed-on-my-system/
(2) http://www.cyberciti.biz/faq/how-do-i-install-a-perl-module/