Installing Perl-CPAN Without Perl-local-lib
I’m still working on getting my brand new CentOS 7 mail server working and I’m having problems with Perl.
Most of the modules are available as RPM’s which was straight forward. However, MIME::Parser, Net::SCP and Net::SSH aren’t.
In order to get these working I installed the perl-CPAN rpm and then installed the modules above. Doing this, installed perl-local-lib.noarch as a dependancy.
The problem now is that when I used CPAN to the above modules they installed without errors, but were only available to the root user.
I can’t uninstall perl-local-lib without uninstalling perl-CPAN and I can’t install perl-CPAN without installing perl-local-lib.
Any ideas on how I can get to do the simple task of installing these modules system wide?
3 thoughts on - Installing Perl-CPAN Without Perl-local-lib
There’s lots of info on it on the web. For the definitive answers look long the local::lib pages on CPAN – basically there are environment variables you can set to say where things are to be installed.
Also, I think when you first run CPAN one of the questions it asks is where to install things – if you let CPAN configure itself it defaults to a local install. You can re-run the CPAN initial config by doing
o conf init
at the CPAN prompt. You may have to clean up your .bashrc as well.
This is probably the most useful link I found
https://stackoverflow.com/questions/32726324/i-installed-a-module-successfully-with-cpan-but-perl-cant-find-it-why
P.
You might want to build rpms for these perl modules, not so hard with cpanspec, eg:
https://www.cyberciti.biz/faq/build-perl-module-rpm-file-with-cpanspec-on-rhel-CentOS/
I simply removed the bashrc entries and that was enough to let me install the modules system wide. I will also investigate cpanspec when I get more chance