Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Broken perl installation on Mac OS X

by NewRun (Novice)
on Jul 06, 2009 at 02:46 UTC ( #777434=perlquestion: print w/ replies, xml ) Need Help??
NewRun has asked for the wisdom of the Perl Monks concerning the following question:

I'm not sure how, but I believe that my perl installation (Mac OS X 10.5.7) is broken. In particular, I cannot get CPAN to work, as I am unable to install even the most basic modules. Is there a way to restore my CPAN installation to the default? To illustrate, this is output I get when I try updating CPAN. The first line is the install command.
cpan[1]> install Bundle::CPAN CPAN: Storable loaded ok (v2.15) Going to read /Users/markwellons/Library/Application Support/.cpan/sou +rces/authors/01mailrc.txt.gz CPAN: File::Which loaded ok (v0.05) Use of uninitialized value in concatenation (.) or string at /Library/ +Perl/Updates/5.8.8/darwin-thread-multi-2level/Scalar/Util.pm line 30. Use of uninitialized value in concatenation (.) or string at /Library/ +Perl/Updates/5.8.8/darwin-thread-multi-2level/Scalar/Util.pm line 30. gzip: /Users/markwellons/Library/Application: not in gzip format gzip: Support/.cpan/sources/authors/01mailrc.txt.gz: No such file or d +irectory DONE Going to read /Users/markwellons/Library/Application Support/.cpan/sou +rces/modules/02packages.details.txt.gz Use of uninitialized value in concatenation (.) or string at /Library/ +Perl/Updates/5.8.8/darwin-thread-multi-2level/Scalar/Util.pm line 30. Use of uninitialized value in concatenation (.) or string at /Library/ +Perl/Updates/5.8.8/darwin-thread-multi-2level/Scalar/Util.pm line 30. gzip: /Users/markwellons/Library/Application: not in gzip format gzip: Support/.cpan/sources/modules/02packages.details.txt.gz: No such + file or directory Warning: Your /Users/markwellons/Library/Application Support/.cpan/sou +rces/modules/02packages.details.txt.gz does not contain a Line-Count +header. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen. CPAN: Time::HiRes loaded ok (v1.86) Warning: Your /Users/markwellons/Library/Application Support/.cpan/sou +rces/modules/02packages.details.txt.gz does not contain a Last-Update +d header. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen. DONE CPAN: LWP::UserAgent loaded ok (v5.823) Fetching with LWP: http://cpan.uchicago.edu/pub/CPAN/modules/03modlist.data.gz Use of uninitialized value in concatenation (.) or string at /Library/ +Perl/Updates/5.8.8/darwin-thread-multi-2level/Scalar/Util.pm line 30. CPAN: YAML loaded ok (v0.68) Going to read /Users/markwellons/Library/Application Support/.cpan/sou +rces/modules/03modlist.data.gz Catching error: "Undefined subroutine &Compress::Zlib::gzopen called a +t /Library/Perl/Updates/5.8.8/CPAN/Tarzip.pm line 122.\cJ" at /Librar +y/Perl/Updates/5.8.8/CPAN.pm line 359 CPAN::shell() called at -e line 1 Going to read /Users/markwellons/Library/Application Support/.cpan/sou +rces/authors/01mailrc.txt.gz No history written (no histfile specified). Lockfile removed. Undefined subroutine &Compress::Zlib::gzopen called at /Library/Perl/U +pdates/5.8.8/CPAN/Tarzip.pm line 122.

Comment on Broken perl installation on Mac OS X
Download Code
Re: Broken perl installation on Mac OS X
by educated_foo (Vicar) on Jul 06, 2009 at 03:05 UTC
    gzip: /Users/markwellons/Library/Application: not in gzip format gzip: Support/.cpan/sources/authors/01mailrc.txt.gz: No such file or d +irect +ory
    Something is failing to escape spaces in filenames. To debug this, try installing the modules in Bundle::CPAN one by one.

    EDIT: Alternatively, look at o conf and change your setting of (at least) cpan_home to something without spaces. You should probably report this as a bug, but in general, to avoid problems with UNIX software, don't put spaces in your filenames.

Re: Broken perl installation on Mac OS X
by graff (Chancellor) on Jul 06, 2009 at 13:30 UTC
    If your setup was working at some point in the past and isn't working now, the best thing might be to go to your "TimeMachine" backup, identify a date when you know for sure it was working, and restore from that date. (I think this involves removing the corrupted Perl resources first.)

    I had a similar event on my mac (I think it arose from a complicated bundle install that went wrong -- I never quite got a clear diagnosis), and restoring from an earlier backup fixed it just fine.

    (You have been using TimeMachine, haven't you?)

Re: Broken perl installation on Mac OS X
by pemungkah (Priest) on Jul 08, 2009 at 03:52 UTC
    The README in /Library/Perl/Updates says that
    In the module search order (@INC), this directory comes before the system perl directory, so modules installed here can be used to update perl-standard modules. The installprivlib Config parameter is now set to this directory, so that (for instance) setting INSTALLDIRS=perl will cause modules to be install here
    So it sounds like if you've got modules that are acting up in there, you should be able to clear this directory out to get back to normal (as in, nothing new's installed).

    What I'd really suggest is installing MacPorts (http://macports.org) and building your own Perl 5.10. It's always dicey to mess with the system Perl, as anything in the system that depends on it will also get broken if you break the system Perl.

      I deleted everything in that folder, and now everything seems to be working again. I do not know what caused the problem or how this fixed it, but I suppose that doesn't matter. Thank you for your assistance.
        I just came across this same problem and as often seems to be the case, PerlMonks had the answer.

        I had a directory called /Library/Perl/Updates/5.8.8 that contained the same readme file as mentioned above. I renamed it to 5.8.8_old, ran CPAN again and modules installed without issue.

        I'm thinking that maybe the problem arises when the machine has been upgraded or restored from an old disk image (Time Machine).

        Short version: +1 for try deleting or renaming anything in /Library/Perl/Updates/.

        Thanks Monks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://777434]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2014-12-18 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (59 votes), past polls