Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

cpan suddenly fails

by glendeni (Acolyte)
on Oct 13, 2013 at 02:06 UTC ( [id://1058029]=perlquestion: print w/replies, xml ) Need Help??

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

I have an on-line server obtained circa 2002 with RHEL3 running /usr/bin/perl 5.8.0. I just tried to install a new module as root as per my usual practice since then, running "/usr/bin/cpan" then "install String::Random". I'd just done that on my local PC without any problems, but on my server it came back with reams of output and ultimately failed.

Something seems to have happened to my cpan installation, as I now get muliple failures when trying to install anything, e.g. "install Bundle::CPAN" - including apparent make failures. So I tried to re-install cpan by running "/usr/bin/cpan" then "o conf init" and manually choosing all the defaults. But that failed with the final output being

Looking for CPAN mirrors near you (please be patient) Catching error: + "Can't locate Time/HiRes.pm in \@INC (\@INC contains: /usr/lib/perl5 +/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/si +te_perl/5$ CPAN::shell() called at /usr/lib/perl5/5.8.0/App/Cpan.pm l +ine 338 App::Cpan::_process_options('App::Cpan') called at /usr/lib/p +erl5/5.8.0/App/Cpan.pm line 421 App::Cpan::run('App::Cpan') called at + /usr/bin/cpan line 12

So something seems hosed, but I don't know enough to deal with this. Is there some different/better way to create a "clean" cpan install??

Replies are listed 'Best First'.
Re: cpan suddenly fails
by ig (Vicar) on Oct 13, 2013 at 05:01 UTC

    From @INC, it looks like you are dealing with the system installation of perl, which was probably installed as a package as part of your system. With some parts installed from packages and others installed from CPAN, it is possible to make your installation dysfunctional.

    You could try re-installing system packages to bring things back to a consistent state, after which you might abstain from installing to the system perl from cpan until you have learned enough to deal with the problems that sometimes occur. If you can, install everything you need from your system's distribution packages.

    If you need modules from CPAN that are not available from your system distribution, you might do best to put a separate installation of perl on your server, to avoid conflicts with the system installation. You could install a more current version of perl, which would also help you avoid problems with new CPAN releases that don't work well on such an old version of perl.

    Installing perl from source is not very difficult, but can be overwhelming if your system does not yet have prerequisites (compiler, make, libraries, etc.), particularly if this is unfamiliar to you. If you are interested in such things, it might be a good learning experience for you. Otherwise, you might be able to get someone familiar with installing perl to help you.

    If this is a production server ("on-line" suggests it is), you would do well to practice installing on a less critical system, until you are confident you know how to do it successfully.

      Upgrading to a newer version of Perl, but leaving your system Perl alone, is easy with Perlbrew. It even allows you to compile a version of Perl yourself without much trouble.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics
Re: cpan suddenly fails
by bioinformatics (Friar) on Oct 13, 2013 at 05:32 UTC

    Just a thought, but is the system using all of the same hardware (i.e., hard drives) that it came with in 2002? 10+ years is a long time, and it's possible this is a hardware issue and not simply a RHEL 3/Perl issue. I had odd issues with Perl when a hard drive controller died on one of my systems awhile ago, producing a corrupted filesystem; it might be worth checking on the drive health.

    Bioinformatics
Re: cpan suddenly fails (cpanmin.us)
by Anonymous Monk on Oct 13, 2013 at 03:43 UTC

    Try one of

    curl -L http://cpanmin.us | perl - -v App::cpanminus

    wget -O - http://cpanmin.us | perl - -v App::cpanminus

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2024-04-25 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found