Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Set incorrect CPAN url repository

by sanPerl (Friar)
on Feb 16, 2012 at 12:28 UTC ( #954213=perlquestion: print w/ replies, xml ) Need Help??
sanPerl has asked for the wisdom of the Perl Monks concerning the following question:

Dear All,

During CPAN installation first time on Linux (using perl -MCPAN -e shell command), I have made a typo and entered some wrong URL as repository, while answering the interactive questions on screen. Now how do I change it ?

UPDATE
=============
My apologies if I am asking stupid question. Due to some reasons my server is restricted from accessing the said URL :-(. Now I just want to install Net::SFTP module, I wonder if I can download the tar.gz file on my laptop from CPAN site and upload it to my Linux server. And then can install it? Is it possible to use CPAN to install this standalone tar.gz file ? I would be grateful if you could direct me to some tutorial which could guide me on this part. The CPAN tutorial on Does Not tell us, what to do if the server cannot access repository.

Comment on Set incorrect CPAN url repository
Download Code
Re: Set incorrect CPAN url repository
by marto (Bishop) on Feb 16, 2012 at 12:43 UTC
    o conf urllist

    Shows you what you have.

    o conf urllist shift

    Removes the incorrect URL you have stored.

    o conf urllist push http://localhost/cpan

    Adds an example URL. If you don't see a line similar to this:

    commit: wrote 'C:\strawberry\perl\lib/CPAN/Config.pm'

    configuraiton changes aren't automatically being saved. Either do:

    o conf commit

    To save the changes you made, or change your configraution to commit changes automatically. I'll leave this as an exercise for you, see o conf options and CPAN.

      Thanks marto, it has helped me a lot.
      Hi marto, can you help me on my updated question please?
Re: Set incorrect CPAN url repository
by moritz (Cardinal) on Feb 16, 2012 at 12:43 UTC
    The easiest way is probably to edit .cpan/CPAN/MyConfig.pm in your home directory. Search for urllist.

    There's also an interactive way in the shell, probably something with o conf urllist, but I can never quite remember the syntax, and you need to remember to o conf commit at the end.

      "and you need to remember to o conf commit at the end."

      I think this depends on your Perl version. Strawberry v5.12.3 which I have on my Windows laptop does it automatically, our clients aging 5.8.8 (I know, I know, we're working on it) installed on Solaris doesn't.

      Update: s/install/installed/

Re: Set incorrect CPAN url repository
by marto (Bishop) on Feb 16, 2012 at 14:08 UTC

    "My apologies if I am asking stupid question. Due to some reasons my server is restricted from accessing the said URL :-(. Now I just want to install Net::SFTP module, I wonder if I can download the tar.gz file on my laptop from CPAN site and upload it to my Linux server. And then can install it? Is it possible to use CPAN to install this standalone tar.gz file ? I would be grateful if you could direct me to some tutorial which could guide me on this part. The CPAN tutorial on Does Not tell us, what to do if the server cannot access repository."

    Which URL are you trying? Have you tried another mirror? Have you contacted your network/system administrators about this? If you can access it from your laptop but not the linux server, and if they're on the same network the sysadmin may be willing to grant access to this.

    When installing modules you'll often need to satisfy dependancies. If for one reason or another the powers that be don't want to alter anything with the server/network config then another option would be to create a mirror of cpan on your laptop. minicpan does this for you. You can then transfer this from your laptop to the linux server and configure cpan to use this rather than a remote server. Please note I'd advise talking to system/network admins before doing any of this. It may be against a policy or something, and you don't want to get in trouble.

    If you don't mind downloading all the dependancies, you can install modules via the traditional method

    perl Makefile.PL make make test make install

    See also Installing Modules from the tutorials section.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2014-12-21 15:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (106 votes), past polls