[Pdx-pm] DON'T SUDO CPAN! [was RE: I think the definition of failsafe is that things should do the safe thing if they fail

Michael R. Wolf MichaelRWolf at att.net
Wed Nov 14 07:38:32 PST 2007

Old thread -- Don't SUDO CPAN!

BTW, thanks for the reference to the discussion at

I'm doing some contract work on a system that's been doing 'sudo cpan' for a
while.  When trying to run as a non-root user, I kept getting error messages
like "Cannot create /root/.cpan".  It was a deadlock situation, requiring
that root continue doing all cpan(1) work.

The problem magically went away when I installed a new Bundle::CPAN.

In general, what's a more reliable way to get back to "factory defaults" so
that CPAN::FirstTime will run for a new user?

Michael R. Wolf
    All mammals learn by playing!
        MichaelRWolf at att.net

> -----Original Message-----
> From: pdx-pm-list-bounces+michaelrwolf=att.net at pm.org [mailto:pdx-pm-list-
> bounces+michaelrwolf=att.net at pm.org] On Behalf Of Michael G Schwern
> Sent: Thursday, October 18, 2007 10:58 AM
> To: Eric Wilhelm
> Cc: pdx-pm-list at pm.org
> Subject: Re: [Pdx-pm] I think the definition of failsafe is that things
> should do the safe thing if they fail
> Eric Wilhelm wrote:
> > # from Daniel Johnson
> > # on Wednesday 17 October 2007 22:46:
> >
> >> Don't write code like in the link!
> >>
> >> http://use.perl.org/~Alias/journal/34680
> >
> > Yeah.  More importantly, don't run such code as root.
> >
> > Note Abigail's method of using a dedicated, unprivileged user to install
> > code from CPAN.  Then the only files at risk are your perl tree.
> That's troublesome because you then have to have different bin and man
> paths
> and make sure PATH and MANPATH are all set up and oh god the burning.
> You don't have to go that far.  CPAN.pm is perfectly capable of sudo'ing
> the
> install phase.  Just do this:
> http://use.perl.org/comments.pl?sid7249&op=&threshold=0&commentsort=0&mode
> =thread&cidX370
> The first-time configurator recommends that approach.
> http://use.perl.org/comments.pl?sid7249&op=&threshold=0&commentsort=0&mode
> =thread&cidX469
> --
> Ahh email, my old friend.  Do you know that revenge is a dish that is best
> served cold?  And it is very cold on the Internet!
> _______________________________________________
> Pdx-pm-list mailing list
> Pdx-pm-list at pm.org
> http://mail.pm.org/mailman/listinfo/pdx-pm-list

More information about the Pdx-pm-list mailing list