Knowledge Base
MilesWeb / Dedicated Server FAQ, VPS FAQ

Can’t locate CPAN.pm in @INC

Approx. read time : 2 min

Perl modules can be installed manually OR using CPAN. If you install perl modules using CPAN, it will resolve all dependencies. It works the same way yum does & is very easy to manage perl modules.

# perl -MCPAN -e shell

When trying to use CPAN with command above you will receive an error which states that there is a need to install perl-cpan on the server.

Can’t locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .).
BEGIN failed–compilation aborted.

Use yum to install perl-cpan with command below.

# yum install perl-CPAN -y

It will install CPAN & dependent RPM’es required. They are perl-Digest-SHA, perl-ExtUtils-MakeMaker, perl-ExtUtils-ParseXS, perl-Test-Harness, perl-devel. If in case you receive any error, make sure CPAN is installed. With our cPanel shared hosting platform perl v5.8.8 is installed.

admin
With over 10+ years of experience in the web hosting industry, I have achieved extensive exposure to result-oriented methodologies. And expertise in different domains like Datacentre Services, Cloud computing technology, Web hosting industry and many more.