Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib64/perl5

Tags:

perl

Im using Centos 6 and install Perl-CPAN and Developement Tools. I cannot seem to install Test:Harness::Straps it get this error:

Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Build.PL line 3.
BEGIN failed--compilation aborted at Build.PL line 3.
Warning: No success on command[/usr/bin/perl Build.PL --installdirs site]

here is my system:

[rileyta@tpcvm106 Downloads]$ uname -a
Linux tpcvm106 2.6.32-220.7.1.el6.centos.plus.x86_64 #1 SMP Wed Mar 7 11:06:23 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

[rileyta@tpcvm106 Downloads]$ perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

[rileyta@tpcvm106 Downloads]$ rpm -ql perl-Params-Validate
/usr/lib64/perl5/Attribute
/usr/lib/64/perl5/Attribute/Params
/usr/lib64/perl5/Attribute/Params/Validate.pm
/usr/lib64/perl5/Params
/usr/lib64/perl5/Params/Validate.pm
/usr/lib64/perl5/Params/ValidatePP.pm
/usr/lib64/perl5/Params/ValidateXS.pm
/usr/lib64/perl5/auto/Params
/usr/lib64/perl5/auto/Params/Validate
/usr/lib64/perl5/auto/Params/Validate/Validate.bs
/usr/lib64/perl5/auto/Params/Validate/Validate.so
/usr/share/doc/perl-Params-Validate-0.92
/usr/share/doc/perl-Params-Validate-0.92/Changes
/usr/share/doc/perl-Params-Validate-0.92/LICENSE
/usr/share/doc/perl-Params-Validate-0.92/README
/usr/share/doc/perl-Params-Validate-0.92/TODO
/usr/share/man/man3/Attribute::Params::Validate.3pm.gz
/usr/share/man/man3/Params::Validate.3pm.gz
/usr/share/man/man3/Params::ValidatePP.3pm.gz
/usr/share/man/man3/Params::ValidateXS.3pm.gz

Here is my cpan settings:

cpan[2]> o conf
$CPAN::Config options from /usr/share/perl5/CPAN/Config.pm:
commit             [Commit changes to disk]
defaults           [Reload defaults from disk]
help               [Short help about 'o conf' usage]
init               [Interactive setting of all options]
applypatch         undef
auto_commit        [1]
build_cache        [100]
build_dir          [/root/.cpan/build]
build_dir_reuse    [0]
build_requires_install_policy [yes]
bzip2              undef
cache_metadata     [1]
check_sigs         [0]
colorize_debug     undef
colorize_output    undef
colorize_print     undef
colorize_warn      undef
commandnumber_in_prompt [1]
commands_quote     undef
connect_to_internet_ok [0]
cpan_home          [/root/.cpan]
curl               undef
dontload_hash      undef
dontload_list      undef
ftp                undef
ftp_passive        [1]
ftp_proxy          []
ftpstats_period    undef
ftpstats_size      undef
getcwd             [cwd]
gpg                undef
gzip               undef
halt_on_failure    [0]
histfile           undef
histsize           undef
http_proxy         []
inactivity_timeout [0]
index_expire       [1]
inhibit_startup_message [0]
keep_source_where  [/root/.cpan/sources]
load_module_verbosity [v]
lynx               undef
make               undef
make_arg           []
make_install_arg   []
make_install_make_command []
makepl_arg         [INSTALLDIRS=site]
mbuild_arg         []
mbuild_install_arg []
mbuild_install_build_command [sudo ./Build]
mbuildpl_arg       [--installdirs site]
ncftp              undef
ncftpget           undef
no_proxy           []
pager              [/usr/bin/less]
password           undef
patch              undef
patches_dir        undef
perl5lib_verbosity [v]
prefer_external_tar undef
prefer_installer   [MB]
prefs_dir          [/root/.cpan/prefs]
prerequisites_policy [ignore]
proxy_pass         undef
proxy_user         undef
randomize_urllist  undef
scan_cache         [atstart]
shell              [/bin/sh]
show_unparsable_versions undef
show_upload_date   [0]
show_zero_versions undef
tar                undef
tar_verbosity      [v]
term_is_latin      [1]
term_ornaments     [1]
test_report        undef
trust_test_report_history [0]
unzip              undef
urllist             0 [www.cpan.org]    1 [http://mirror.uta.edu/CPAN/]     2 [ftp://mirror.quintex.com/CPAN/]  3 [http://cpan.cs.utah.edu/CPAN/]
use_sqlite         [0]
username           undef
version_timeout    undef
wait_list          undef
wget               undef
yaml_load_code     [0]
yaml_module        undef

Should I change the mbuild_install_build_command????? I use sudo to execute on this cpu.

I tried to follow other solution from this site but I still get that error and cannot install other TAP because of the Module::Build error. Is it that I install perl-CPAN and not yum version or should I go to another version other than 5.10.1

like image 611
user270400 Avatar asked Feb 14 '14 16:02

user270400


1 Answers

Ubuntu 16-18 notes:

run with sudo

apt install cpan #after install, run cpan
cpan

in cpan cli, write and hit enter

install Module::Build

also in cpan cli you may install additional Netmask module, long compilation with many times need hit Y key

install Net::Netmask

so after install cpan you may be need reboot, after all, try to run

perl ./Build.PL #don't worry about warnings with "META" generation..
sudo ./Build installdeps #you may see message All prerequisites satisfied
sudo ./Build test
sudo ./Build install
like image 134
ITz Avatar answered Oct 16 '22 07:10

ITz