Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Mirror CPAN installed modules

by Anonymous Monk
on Nov 25, 2006 at 06:56 UTC ( #585979=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a bunch of servers, and I have a few CPAN modules that I want to be installed on all of the servers.

What is the best way to get the modules installed?

Is there a way to install a CPAN module on one machine and have the module automatically install on the other machines?

Replies are listed 'Best First'.
Re: Mirror CPAN installed modules
by osunderdog (Deacon) on Nov 25, 2006 at 07:19 UTC

    What OS are these servers running? Can you ensure that they are all the same and at the same patch level?

    If so, you could install the perl modules to a mountable file system (using the unix vernacular) and then mount that location from all the other servers. Ideally, you would use the same mount location on all the servers. You would then need to include that mount location as part of the perl search path: PERLLIB

    If you're using perl modules that do not have compile code, you don't have to worry (too much) about the patch level...

    I know that this technique works on both windows and unix.

    Your mileage may vary.

    Hazah! I'm Employed!

Re: Mirror CPAN installed modules
by BUU (Prior) on Nov 25, 2006 at 11:39 UTC
Re: Mirror CPAN installed modules
by Firefly258 (Beadle) on Nov 25, 2006 at 15:54 UTC
    This page has info on conversion scripts which help converting from tarballs found on the CPAN network to the local package format e.g. .rpm, .deb, etc.

    Most package management systems allow you to install perl modules via a shell command. e.g. yum install perl-libwww-perl on RedHat or aptitude install libwww-perl on Debian. Almost every distro has something like this, Activestate Perl on Win32 even has PPM. You could write a shell script to install the various modules you need.

    I prefer to use CPAN as most package management repositories only have a subset of the CPAN modules in the local format, furthermore, they arent guaranteed to be up2date.
    $ cpan -i Tk
    Or using CPAN from within a perl script itself.
    #!/usr/bin/perl -W use strict; use CPAN; while (<DATA>) { chomp; install $_; } __DATA__ Foo::Bar Foo::Baz Foo::Quux
Re: Mirror CPAN installed modules
by roboticus (Chancellor) on Nov 25, 2006 at 14:23 UTC
    ...and there's always rsync for *NIX and RoboCopy for Win*. Install the code on one machine (the master) and use one of those tools to keep the other machines up-to-date with respect to the master...

    (Though I prefer the first two suggestions you were given...)


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://585979]
Approved by ikegami
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2021-01-24 10:10 GMT
Find Nodes?
    Voting Booth?