http://qs321.pair.com?node_id=566356

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

I'm getting the following error message. Could you help me dubug this by suggesting another step. Manual installing via sudo works ok but takes too long because of the requistes.
perl -MCPAN -e 'install Net::AIM' CPAN: Storable loaded ok Going to read /Users/richill/.cpan/Metadata Database was generated on Tue, 08 Aug 2006 19:33:49 GMT Running install for module Net::AIM Running make for A/AR/ARYEH/Net-AIM-1.22.tar.gz mkdir /Users/richill/.cpan/sources/authors/id/A/AR: Permission denied +at /System/Library/Perl/5.8.1/CPAN.pm line 2326

The line is

File::Path::mkpath($aslocal_dir);

I have tried using sudo, i thought id just bully the code into installing.

$ sudo perl -MCPAN -e 'install Net::AIM' CPAN: Storable loaded ok Going to read /Users/richill/.cpan/Metadata Database was generated on Tue, 08 Aug 2006 19:33:49 GMT Running install for module Net::AIM Running make for A/AR/ARYEH/Net-AIM-1.22.tar.gz CPAN: LWP::UserAgent loaded ok Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/authors/id/A/AR/ARYEH/Net-AIM-1.22.tar.g +z CPAN: Digest::MD5 loaded ok Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/authors/id/A/AR/ARYEH/CHECKSUMS CPAN: Compress::Zlib loaded ok Checksum for /Users/richill/.cpan/sources/authors/id/A/AR/ARYEH/Net-AI +M-1.22.tar.gz ok Scanning cache /Users/richill/.cpan/build for sizes Deleting from cache: /Users/richill/.cpan/build/Bundle-libnet-1.00 (17 +.8>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/YAML-0.62 (17.8>10.0 M +B) Deleting from cache: /Users/richill/.cpan/build/Bundle-CPAN-1.852 (17. +4>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/libwww-perl-5.805 (17. +4>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Digest-SHA-5.43 (15.7> +10.0 MB) Deleting from cache: /Users/richill/.cpan/build/File-Temp-0.16 (15.5>1 +0.0 MB) Deleting from cache: /Users/richill/.cpan/build/File-HomeDir-0.58 (15. +3>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/PathTools-3.19 (15.2>1 +0.0 MB) Deleting from cache: /Users/richill/.cpan/build/Compress-Zlib-1.42 (14 +.8>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Archive-Tar-1.30 (13.9 +>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Archive-Zip-1.16 (13.7 +>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Data-Dumper-2.121 (13. +3>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Net-Telnet-3.03 (13.2> +10.0 MB) Deleting from cache: /Users/richill/.cpan/build/libnet-1.19 (13.0>10.0 + MB) Deleting from cache: /Users/richill/.cpan/build/TermReadKey-2.30 (12.8 +>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Term-ReadLine-Perl-1.0 +302 (12.7>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Text-Glob-0.07 (12.5>1 +0.0 MB) Deleting from cache: /Users/richill/.cpan/build/Module-Build-0.2805 (1 +2.5>10.0 MB) Deleting from cache: /Users/richill/.cpan/build/CPAN-1.87 (11.8>10.0 M +B) Deleting from cache: /Users/richill/.cpan/build/File-Which-0.05 (11.0> +10.0 MB) Deleting from cache: /Users/richill/.cpan/build/MIME-Types-1.16 (11.0> +10.0 MB) Deleting from cache: /Users/richill/.cpan/build/Encode-2.18 (10.9>10.0 + MB) Net-AIM-1.22/ Net-AIM-1.22/AIM/ Net-AIM-1.22/AIM/Connection.pm Net-AIM-1.22/AIM/Event.pm Net-AIM-1.22/AIM.pm Net-AIM-1.22/MANIFEST Net-AIM-1.22/Makefile.PL Net-AIM-1.22/PROTOCOL Net-AIM-1.22/README Net-AIM-1.22/TODO Net-AIM-1.22/aimtest Net-AIM-1.22/Net CPAN.pm: Going to build A/AR/ARYEH/Net-AIM-1.22.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Net::AIM -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible

So It looks to me like there is a either aproblem with the make that CPAN uses or the permissions.

As the files affected are created on the fly i maybe need to configure CPAN.pm to create them with different permissons. Any suggestions?

Is it possible to get more inforamtive error messages.

I hope you can help, even if I just need a clean install.

Replies are listed 'Best First'.
Re: Im struggling to use cpan to install modules
by Roger (Parson) on Aug 09, 2006 at 08:32 UTC
    You could try to repeat the CPAN build process manually. Whenever CPAN build fails, I will chdir to ~/.cpan/build/<moudle> directory, then do a manual build under that directory by:

    perl Makefile.PL
    make | tee make.log
    make test

    This will always give me warm and fuzzy feeling that I am in control, and it will always give me (or enable me to find out) the precise reason of build failure. You may either need to 'sudo' the make process, or to reset the owner/group of your 'stuffed-by-sudo' CPAN build directories.

      Hi Rodger, does that mean I can download the dependant modules via cpan, then make them manually
        does that mean I can download the dependant modules via cpan, then make them manually
        Yes, that means just that :)

        Try look Net::Aim from the cpan shell command line and it opens up a subshell in the appropriate directory. Then you can manually do the make.

        -- Hofmator

        That's correct, you can download modules and build them manually.
Re: Im struggling to use cpan to install modules
by tweetiepooh (Hermit) on Aug 09, 2006 at 08:48 UTC
    Depending on your setup but these may work.

    1)su -; then set up paths etc and do the whole process as root. You may need to fiddle with the build directories initially.

    2)sudo make install; it's only this last stage that needs the special permissions. However some modules seem to also do some other tasks here that may fail.

    3)Change the permissions on the perl lihrary directories. I've done this, putting my self in a perladmin group and making that group own /usr/local/lib/perl5 (or where ever on your system).

    4)I think that CPANPLUS has the option to sudo for the make install phase, so install that and configure appropriately.

    Some of these are inherinantly less safe than others, use what is best for you and your environment.

      I think that CPANPLUS has the option to sudo for the make install phase
      with CPAN.pm you also can configure your make install command.
      o conf make_install_make_command

      I think this is the place where you'd put the sudo.

        That did the job, Ive spent 2 days working out CPAN but I think its time well spent. Thanks for your help.
      Im showing my ignorance but What are the safety issues to consider.
        Well if you make the library directory writeable to a wider set of people it becomes easier to install something duff or nasty.

        The same goes for using a sudo type mechanism.

        Doing anything as root provides the chance to break all sorts of things. What if you get a module where someone has put something into the make to break your system?

        OK so some of these are not likely but they could happen.

Re: Im struggling to use cpan to install modules
by cdarke (Prior) on Aug 09, 2006 at 08:27 UTC
    You need write and execute access to all the directories in /Users/richill/.cpan/sources/authors/id/A.