APM: The proper way to use CPAN on a server

Jonathan Scott Duff duff at pobox.com
Fri Apr 9 10:32:40 PDT 2010


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/1768a11a/attachment.html>


More information about the Austin mailing list