Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

using Perl modules on airgapped system

by psyllex (Initiate)
on Apr 19, 2013 at 16:59 UTC ( #1029551=perlquestion: print w/replies, xml ) Need Help??
psyllex has asked for the wisdom of the Perl Monks concerning the following question:

Hello fine people. I've used perl for years but few and far between. I am having a problem. I have a script I'd like to run but it needs IO::Socket and IO::ForkManager And then I believe IO::Socket will need Net::SSLeay. I don't have internet access on the system I"m attempting to use this on so I can't just install it 'the regular way'. I didn't see any instructions on how to download, and make those packages on CPAN. Does anyone have any suggestions on how to accomplish this? I'm sure it can be done I just haven't run across a solution as of yet.

Replies are listed 'Best First'.
Re: using Perl modules on airgapped system
by dasgar (Priest) on Apr 19, 2013 at 17:11 UTC

    What operating system are you using?

    If you are on Windows and have a USB port available, I would recommend checking out portable Strawberry Perl and put it on a USB stick drive. You can move the USB stick drive to a system with internet access to get more modules installed.

    If you're on something like Linux, I think you can use something like CPAN::Mini to create a local "mirror" of CPAN on something like a USB stick drive and then move that to the isolated system to use for any CPAN installs. (Note: I personally have not used CPAN::mini before, so I would not be able to offer any assistance on how to use that module.)


      CPAN::Mini is reasonably straightforward to use. Once you have built your local mirror, you configure the urllist in CPAN to start with a file: URL that points to the mirror. After that, it's the same as for a connected system, but no internet latency.

Re: using Perl modules on airgapped system
by topher (Scribe) on Apr 20, 2013 at 03:40 UTC

    There are a couple of ways you can approach this, depending on your specific requirements and preferences.

    First, as a couple people have mentioned, you could look at something like CPAN::Mini. Basically, you'd build a local mirror of the packages you'd need. I'd probably look at this option if I had multiple machines I needed to install to.

    The rest of the options assume you have a dev box that is similar to your deployment target, where you can do your initial work.

    The second option would be to make use of something like App::FatPacker to help package up your prerequisites into a single file that you could easily copy over. If the systems are substantially similar outside of the Perl modules, this might be among the easiest. Note: if the Perl modules require any compiled libraries, I'm not sure if App::FatPacker grabs them or now.

    Similar to the previous option, you could use local::lib to install all of your CPAN modules, then tar up the whole set and copy it to your destination. This will work provided the systems are very similar. This can also be used with App::FatPacker to simplify things. local::lib also includes lib::core::only to make sure you've got your dependencies clear for things like App::FatPacker.

    If the dev box and production box are not similar enough for the above options to work, you could use App::perlbrew to install a complete Perl installation, then install your dependencies, and then tar up the whole mess and copy it to your destination. I've done this successfully, so I know it works. It's probably the most time intensive of the solutions, though.

    Christopher Cashell
Re: using Perl modules on airgapped system
by Anonymous Monk on Apr 20, 2013 at 04:10 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1029551]
Approved by dasgar
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-06-17 22:28 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (107 votes). Check out past polls.