1. 程式人生 > >cpan安裝perl module的方法和步驟(備忘帖)

cpan安裝perl module的方法和步驟(備忘帖)

roo for lora pre permanent help base -i rmi

適用場景:不具備root權限且沒有sudo權限的普通用戶安裝perl module
安裝步驟:
1)
刪除/.cpan/.lock
rm -rf /home/users/.cpan/.lock
2)進入cpan交互模式
perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter ‘h‘ for help.

cpan[1]> o conf mbuildpl_arg "--install_base /home/USER/extra_lib/

"
mbuildpl_arg [--install_base /home/USER/extra_lib/]
Please use ‘o conf commit‘ to make the config permanent!


cpan[2]> o conf makepl_arg "PREFIX=/home/USER/extra_lib/"
makepl_arg [PREFIX=/home/USER/extra_lib/]
Please use ‘o conf commit‘ to make the config permanent!


cpan[3]> install JSON

cpan安裝perl module的方法和步驟(備忘帖)