Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Installing Perl modules automatically

by Anonymous Monk
on Dec 08, 2007 at 11:58 UTC ( [id://655818]=perlquestion: print w/replies, xml ) Need Help??

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

Hello monks,
I have installed Cygwin afresh on Windows 2003 Server. And I have to install additional Perl modules which are not included in default installation. In order to do it automatically, I have created local mirror (by using cpan::mini module) and reconfigured MyConfig.pm file, so it will work with my local mirror. I use following command for modules installation:

perl -MCPAN -e install Bundle::Snapshot_XXXX_XX_XX_XX
And until today it was working fine. Now, I am getting the following error:
CPAN: Storable loaded ok Going to read /home/ABC/.cpan/Metadata Database was generated on Tue, 03 Jul 2007 19:56:10 GMT LWP not available No external ftp command available Please check, if the URLs I found in your configuration file(file://// +cygdrive/c/cygwin/home/ABC/local/LocalMirror/) are valid. The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/ +'

It looks like it is trying to connect to the internet and fails. (My local network has no connection to the internet). My MyConfig.pm hasn't been changed and it exactly the same file that is working perfectly on other machines. My guess is that there are other configuration files that overwrite MyConfig.pm file.

What shall I do in order to solve this problem?

Many thanks

20080115 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

Replies are listed 'Best First'.
Re: Installing Perl modules automatically
by Herkum (Parson) on Dec 08, 2007 at 12:55 UTC

    See if you can use FTP (manually) to connect to your local mirror from that machine. If no FTP your system is having an issue.

    If FTP works to another site, check to see if you can see if you can get to your mirror. In theory your mirror maybe down.

    See if you can manually install modules via CPAN. If not the most likely thing is that your cpan config is screwed up if you can do the previous two steps.

      Thank you for the quick response.
      Could you please be more specific about FTP issue because it is not quite clear for me why should check if it is possible to use ftp. In MyConfig.pm file I gave local URL and from the error log I can see that it was found:

      Please check, if the URLs I found in your configuration file(file:////cygdrive/c/cygwin/home/ABC/local/LocalMirror/) are valid.

      I can download and manually install modules from CPAN. I agree with you that, apparently cpan config is screwed up. But what exactly are those files and where I can find them?

      Thanks

        Could you please be more specific about FTP issue because it is not quite clear for me why should check if it is possible to use ftp

        the CPAN utility will use the ftp command-line utility to do FTP's. If it cannot find 'ftp', it cannot get the information from your mirror. It might be a search path problem for the user account or the utility got moved or deleted.

        Please check, if the URLs I found in your configuration

        I would not worry about that so much if you are getting the 'ftp' is missing error. You can be getting this error simply because of poor error handling on the part of the program.

Re: Installing Perl modules automatically
by bdimych (Monk) on Dec 08, 2007 at 15:46 UTC
    1. If you have fast internet, then I recommend you to install two cygwin categories "Network" and "Devel" entirely

    2. As I noticed, CPAN module routinely try to download the list of modules from CPAN servers

      If you have fast internet, then I recommend you to install two cygwin categories "Network" and "Devel" entirely

      I have installed the whole "Devel" category and and I will install "Net". As I see it has several ftp options

      As I noticed, CPAN module routinely try to download the list of modules from CPAN servers

      Do you know how I can cancel it? Do you know any files (except MyConfig.pm) that are resposible for CPAN configuration?

      Thanks

      Edit: g0n - fixed broken BR tags

        >Do you know how I can cancel it?
        Sorry, I don't know, I never tried to change default options

        -----
        I'm just now reading man CPAN. Option "index_expire" may be what you need.

Re: Installing Perl modules automatically
by CountZero (Bishop) on Dec 08, 2007 at 21:31 UTC
    Are you sure CPAN is reading the right config file? If you have multiple users installed on your machine, each may have its own MyConfig.pm which will override the system wide Config.pm and if you install as a different user, you may very well get different results.

    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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found