in reply to Re: Can't use CPAN.pm once gpg installed
in thread Can't use CPAN.pm once gpg installed

I call 'sudo cpan' to initiate the CPAN shell. Which, as far as I know, is what I need to do, in order to install CPAN modules under /usr/local/lib rather than somewhere under ~.

So I guess I'm not running as the owner of the gpg.conf file. But the message you cite implies that this shouldn't be a problem.

jimk

UPDATE: If I simply call cpan without sudo-ing first, I avoid all the 'unsafe ownership' messages -- but, not surprisingly, can't install the files or the docs under /usr/local/.

The only way that I can use the CPAN shell to install is to temporarily rename .gnupg/, then call sudo cpan, do the installation, and then change back to .gnupg/. Not exactly user friendly!

Am I the only one experiencing this problem?

Replies are listed 'Best First'.
Re^3: Can't use CPAN.pm once gpg installed
by randyk (Parson) on Jan 30, 2006 at 04:18 UTC
    Recent versions of CPAN.pm support a make_install_make_command configuration setting, which is used to set the make command for running make install. Does setting this to "sudo make" work?
      An interesting idea: In effect, delay the sudo call until you reach the one step in the process where it's absolutely necessary. I'll check this out tonight when I get back to that machine. Thanks.

      jimk

      Unfortunately, the suggestion didn't work. In ~/.cpan/CPAN/MyConfig.pm for v1.83 of CPAN.pm, I made the following change:

      < 'make_install_make_command' => q[/usr/bin/make], --- > 'make_install_make_command' => [ q[sudo], q[/usr/bin/make] ],

      These were the results observed while trying to install a pure Perl distribution from CPAN:

      And so it wasn't installed. When I restored MyConfig.pm to the version that came with 1.83, then temporarily hid the ~/.gnupg directory, then called sudo cpan, the module installed properly, with only the following warning message:

      WARNING: This key is not certified with a trusted signature! Primary key fingerprint: [a key which I think is the module author's] Signature for /Users/jimk/.cpan/sources/authors/id/D/DA/DAGOLDEN/CHECK +SUMS ok Fetching with LWP: http://www.cpan.org/authors/id/D/DA/DAGOLDEN/CHECKSUMS WARNING: This key is not certified with a trusted signature! Primary key fingerprint: [a key which I think is the module author's]
      So I'm pretty much back where I started.

      jimk

        Running make for D/DA/DAGOLDEN/File-Marker-0.10.tar.gz. Warning: You are not allowed to write into directory "/Users/jimk/.cpan/sources/authors/id/D/DA/DAGOLDEN". I'll continue, but if you encounter problems, they may be due to insufficient permissions.
        I imagine this, and similar, warnings/errors are due to the fact that the relevant directories were originally created by root, and now you're running things as jimk. Try changing the ownership of everything under /Users/jimk/.cpan/ to jimk (and also adjust the group, if relevant).
Re^3: Can't use CPAN.pm once gpg installed
by Errto (Vicar) on Jan 30, 2006 at 16:21 UTC
    I've faced a similar issue. The problem with 'sudo cpan' as opposed to, say, 'su - -c cpan' (roughly) is that with sudo your user's environment is still active and CPAN.pm will, by default, use your home directory as its repository and pick up other config files from there.

      The equivalent switch for sudo is -i.

      Makeshifts last the longest.