APM: The proper way to use CPAN on a server

Jonathan Scott Duff duff at pobox.com
Fri Apr 9 11:05:29 PDT 2010


On Fri, Apr 9, 2010 at 12:53 PM, David Maynard <dmaynard at outserv.net> wrote:

>  This usually isn’t very popular with developers, but if it is a
> production server we don’t use CPAN if we can avoid it.  Instead we install
> RPM packages of the modules.  The main reason is that we want to have
> repeatable server builds.  It also helps you need the code to be portable to
> “stock” Red Hat systems.
>

Indeed.  Relying on your package manager is the recommended way for servers
... when you can get packages that have all of the things you need.  :-)

For the longest time we would use CPAN to install PDL because the RedHat
package was broken in some way that was important to us (it's been a while,
so I forget the specifics).  But now we just the perl-PDL package and don't
worry about getting it from CPAN.

-Scott

> For Red Hat/CentOS, the DAG (http://dag.wieers.com/) yum/RPM repository
> has a good selection of Perl packages.  There are a couple of other
> repositories that tend to have more bleeding-edge versions, but they haven’t
> been around as long.
>
>
>
> -dpm
>
>
>
> *From:* austin-bounces+dmaynard=outserv.net at pm.org [mailto:
> austin-bounces+dmaynard <austin-bounces%2Bdmaynard>=outserv.net at pm.org] *On
> Behalf Of *Jonathan Scott Duff
> *Sent:* Friday, April 09, 2010 12:33 PM
> *To:* Tim McDaniel
> *Cc:* Austin at pm.org
> *Subject:* Re: APM: The proper way to use CPAN on a server
>
>
>
> I typically don't run cpan via sudo but rather set the install commands
> within cpan to use sudo.  From the cpan> prompt:
>
>
>
>  cpan> o conf make_install_make_command 'sudo /usr/bin/make'
>
> cpan> o conf mbuild_install_build_command 'sudo ./Build'
>
> cpan> o conf commit # may not be needed
>
>
>
> Then, whenever you install via cpan, it will use sudo to install modules.
>
>
>
> Also, I often will run cpan thusly:
>
>
>
>   $ PERL_MM_USE_DEFAULT=1 cpan Bundle::CPAN
>
>
>
> That causes cpan to accept the default answers to any prompts as it
> installs the CPAN bundle.  This is usually so I don't have to repeatedly
> answer "y" to install required modules.
>
>
>
> Since you're asking about upgrading, there's another useful thing you can
> do:
>
>
>
>   perl -MCPAN -e 'CPAN->upgrade(/^Catalyst::/)'
>
>
>
> That'll upgrade all of the installed modules that start with "Catalyst::"
>  read the CPAN docs for more info.
>
>
>
> hope this helps,
>
>
>
> -Scott
>
>
>
> On Fri, Apr 9, 2010 at 11:58 AM, Tim McDaniel <tmcd at panix.com> wrote:
>
> I've been lazy due to being on a single-user machine, either at home
> or a Windows box at work.
>
> I got IT at work to install Perl 5.10.1 on a server.  I want to update
> the modules for all users.  I've had an odd amount of trouble finding
> info on the Proper Way to upgrade -- maybe my Google-fu is weak today.
> Is it as simple as "sudo cpan upgrade"?  Should I worry about
> upgrading CPAN itself first, if necessary, and if so, how?  Are there
> any modifications due to
>    Red Hat Enterprise Linux Server release 5.4 (Tikanga)
> ?
>
> --
> Tim McDaniel, tmcd at panix.com
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/austin/attachments/20100409/55d56c13/attachment.html>


More information about the Austin mailing list