[精讚] [會員登入]
35

[Linux] 使用tarball安裝下載PERL的tar檔模組

在Linux下,perl下載的pm模組,不使用cpan的安裝方法

分享此文連結 //n.sfs.tw/16049

分享連結 [Linux] 使用tarball安裝下載PERL的tar檔模組@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2023-01-11 01:22:00 最後編修
2023-01-10 16:36:43 By 張○○
 

自動目錄

有時用 cpan安裝失敗,或許可以採用改用tarball安裝,perl的模組tarball可以去metacpan找

 

1. 下載及解壓tar檔

以實際例子舉例,例如執行某 perl檔時發生以下錯誤:

Can't locate Text/Iconv.pm in @INC (you may need to install the Text::Iconv module) (@INC contains: …)

可以發現Text/Iconv模組不存在,因此到 metacpan的網站,貼上Text/Iconv並搜尋。

清單可能會找到很多的目標,選擇 Text::Iconv 這種多半就是套件本身。

點進去後,左側 Download 下方複製連結網址

並到系統中下載即可

解壓

$ tar zxvf Text-Iconv-1.7.tar.gz

 

 

2. 安裝

進到解壓後的目錄,因為安裝會動到系統目錄,用root權限執行

# cd Text-Iconv-1.7

# perl Makefile.PL

上面的指令如果沒安裝cpan模組的話會出錯,請參看下面錯誤排除

# make

# make install

"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Iconv.bs blib/arch/auto/Text/Iconv/Iconv.bs 644
Manifying 1 pod document
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib64/perl5/5.32/auto/Text/Iconv/Iconv.so
Installing /usr/local/lib64/perl5/5.32/Text/Iconv.pm
Installing /usr/local/lib64/perl5/5.32/auto/Text/Iconv/autosplit.ix
Installing /usr/local/share/man/man3/Text::Iconv.3pm
Appending installation info to /usr/lib64/perl5/perllocal.pod

 

錯誤排除

1. 下指令 perl Makefile.PL 出現錯誤 Can't locate ExtUtils/MakeMaker.pm in @INC (you may need to install the ExtUtils::MakeMaker module)

解決[1]:

# yum install perl-CPAN

2. make 出現 -bash: make: command not found

解決:

# yum install gcc

3. Can't locate IO/Socket/INET6.pm in @INC (you may need to install the IO::Socket::INET6 module)

解決:

[Centos]

# yum install perl-IO-Socket-INET6 perl-Socket6

[Ubuntu]

# apt-get install -y libio-socket-inet6-perl

4. Can't locate Net/DNS.pm in @INC (you may need to install the Net::DNS module)

解決:

[Centos]

# dnf install perl-Net-DNS

[Ubuntu]

# apt-get install -y libnet-dns-perl

5. Can't locate Text/Iconv.pm in @INC (you may need to install the Text::Iconv module)

[Centos]

上方tarball安裝

[Ubuntu]

# apt-get install libtext-iconv-perl

參考資料

[1] https://blog.xuite.net/tailsice/twblog/204924951-%E7%B7%A8%E8%AD%AF%E5%AE%89%E8%A3%9D%E6%99%82%E5%87%BA%E7%8F%BECan%27t+locate+ExtUtils%2FMakeMaker.pm#

[2] https://zoomadmin.com/HowToInstall/UbuntuPackage/libnet-dns-perl

[3] https://www.devmanuals.net/install/ubuntu/ubuntu-12-04-lts-precise-pangolin/install-libtext-iconv-perl.html

END

你可能感興趣的文章

[CENTOS8] Failed to download metadata for repo 'appstream' 的問題 Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist的解決方法。

移除ssl 私鑰的密碼 現在用ssl產生私鑰會需要設定密碼,但是私鑰有密碼,啟動apache會失敗。

[CENTOS7] 使用 logrotate 來整理wildfly日誌檔 解決 wildfly 的日誌檔不斷長大的問題

[Centos7] 安裝apache+php7+mariadb10+selinux Centos7 安裝apache+php7+mariadb10+selinux

[Rocky9] codeignitor4+ nginx+ php8.1-fpm + docker compose 這次的目標是把服務裝在docker,裡面放入 nginx 和 php8.1-fpm的 docker container, 並採用codeignitor4。

[CentOS] 設定和使用quota quota 的觀念已經很老了,不過每次都會忘記所以寫下來,有需要觀念的朋友請參看鳥哥的網站吧

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

使用Google尋找你的手機 這近發現google竟然可以用來找android的手機,而且不需要經過什麼設定或安裝軟體。

UTF8中文字/全形一覽 快速查詢urf-8的中文字,共計13246中文字(5401常用字+7652罕用字+日文或編號),292全形符號,27半形符號。

[bc] linux 的計算機 bc 設定小數位數、計算π、次方根 linux 的計算機 bc 設定小數位數、計算π、次方根

維修冰箱 維修冰箱

魔球中小女孩唱的歌 The show 魔球中小女孩唱的歌 The show