Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Perl modules with lots of dependencies on a machine without CPAN network access

Tags:

perl

cpan

I am trying to install the DateTime machine on a Linux server. Unfortunately, this Linux server has some restricted network access policy that prevents me from using the CPAN shell directly to download content, or installing cpanminus. Changing the access policy is beyond my control, so I am looking for a workaround. I also don't have root access to this Linux server.

I can, however, download anything to my work's Window machine, and upload to a file share on this server. So I started to pull down the DateTime dependencies one by one. I would download a module, sometime it will have Makefile.PL, sometime it will have Build.PL. I then rebase each Build or Makefile to my INSTALL_BASE, test each module. I did that for about 20 modules, and the trees seem to expand to ever smaller classes with no end in sight...

I hope you can tell me a better way. Is there a way I can initiate a download from a machine with CPAN access (ie. my Windows box) of all the DateTime dependencies into one giant Perl package, upload it to the Linux server, and run CPAN there (without network access) to put things in the right place? Thanks.

like image 234
frank Avatar asked Jun 20 '13 07:06

frank


People also ask

How install Perl modules Linux CPAN?

To install Perl modules using CPAN, you need to use the cpan command-line utility. You can either run cpan with arguments from the command-line interface, for example, to install a module (e.g Geo::IP) use the -i flag as shown.

Does Perl come CPAN?

CPAN.pm, CPANPLUS, and cpanminusAn interactive shell called cpan is also provided in the Perl core, and is the usual way of running CPAN.pm. After a short configuration process and mirror selection, it uses tools available on the user's computer to automatically download, unpack, compile, test, and install modules.


1 Answers

The most efficient way by far is to make a minicpan, install cpanm on the linux machine and alias localcpanmsomething like this:

alias localcpanm='cpanm --mirror file:///Users/Shared/cpan/ --mirror-only'

I have used this technique on long train journeys with patchy network access with great success.

like image 140
singingfish Avatar answered Sep 17 '22 13:09

singingfish