Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

cpanm --sudo installs to /root/perl5 instead of /usr

by 1arryb (Acolyte)
on Jun 25, 2012 at 18:57 UTC ( [id://978240]=perlquestion: print w/replies, xml ) Need Help??

1arryb has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks

I have been using this script to install system perl modules and, up until trying it on an FC14 installation, it's worked great. On the new machine, however, it installs modules under /root, which isn't supposed to be the --sudo cpanm behavior. According to the App::cpanminus perldoc:

cpanminus at a boot time checks whether you have configured local::lib, or have the permission to install modules to the site_perl directory. If neither, it automatically sets up local::lib compatible installation path in a "perl5" directory under your home directory. To avoid this, run the script as the root user, with "--sudo" option or with "--local-lib" option.

I have tried it as root with and without --sudo, and cpanm will not install into /usr on this mahcine.

What am I missing?

Thanks, Larry

  • Comment on cpanm --sudo installs to /root/perl5 instead of /usr

Replies are listed 'Best First'.
Re: cpanm --sudo installs to /root/perl5 instead of /usr
by syphilis (Archbishop) on Jun 26, 2012 at 00:21 UTC
    What am I missing?

    Perhaps it's just the way that the particular perl has been configured.
    Try running the following script (using the perl that's giving you the problem):
    use strict; use warnings; use Config; for(keys(%Config)) { print "$_ : $Config{$_}\n" if $_ =~ /install/i; }
    That should give you a listing of where perl wants various things to be installed. (Don't be worried if some of the keys are unset.)

    Cheers,
    Rob
Re: cpanm --sudo installs to /root/perl5 instead of /usr
by Anonymous Monk on Jun 26, 2012 at 04:33 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://978240]
Approved by Corion
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-16 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found