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

Are you running this as the jimk user? This message indicates that this error can result from running gpg as someone who is not the owner of the gpg.conf file.
  • Comment on Re: Can't use CPAN.pm once gpg installed

Replies are listed 'Best First'.
Re^2: Can't use CPAN.pm once gpg installed
by jkeenan1 (Deacon) on Jan 30, 2006 at 02:30 UTC
    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?

      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

      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.