Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell CPAN.pm where to get modules?

Tags:

yaml

perl

cpan

Here is the complete install command to CPAN and the output:

sudo perl -MCPAN -e "install Bundle::CPAN"
CPAN: Storable loaded ok (v2.13)
Going to read /home/delgreco/.cpan/Metadata
  Database was generated on Mon, 08 Dec 2008 03:27:10 GMT
CPAN: LWP::UserAgent loaded ok (v2.033)
CPAN: Time::HiRes loaded ok (v1.55)
CPAN: YAML loaded ok (v0.39)
Warning: YAML version '0.39' is too low, please upgrade!
I'll continue but problems are *very* likely to happen.
Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist
push ftp://myurl/'

Could not fetch authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz
Giving up on '/home/delgreco/.cpan/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz'
Note: Current database in memory was generated on Mon, 08 Dec 2008 03:27:10 GMT

        ...propagated at /usr/lib/perl5/5.8.5/CPAN.pm line 3417.

This worked for me, thanks...

cpan> o conf urllist http://cpan.yahoo.com/

Of course, the Bundle::CPAN install proceeded to fail on other dependencies, but at least I have a YAML 0.68 now.

like image 759
Marcus Avatar asked Dec 08 '08 21:12

Marcus


2 Answers

This looks important:

Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'

Perhaps run sudo cpan, then o conf init or o conf urllist push http://cpan.yahoo.com/ (for example) to get your urllist straightened out? Then try to do your installs.

like image 144
oeuftete Avatar answered Oct 06 '22 01:10

oeuftete


When you first used the CPAN module, you were asked something along the lines of "Are you ready to proceed with interactive configuration?" You probably answered "no." Default configuration options were selected, and so no CPAN repository mirrors were configured for you to pull module tarballs from.

As others have noted, you can configure that option with the o conf urllist command inside the CPAN shell.

My personal preference is to create a "miniCPAN," a local repository that basically contains the latest version of each module (much smaller than pulling ALL of CPAN, which would contain many out of date versions of each module). To do this, configure a CPAN mirror repository to use temporarily, install the CPAN::Mini module from it, then use the minicpan command-line program which will be installed to create your repository. Now use o conf urllist pop to remove the CPAN mirror you configured, and o conf urllist push file:///path/to/your/minicpan to tell the CPAN module to install from your local mirror from now on. You can put the minicpan command in cron to update regularly, or just run it from the command-line whenever you want to refresh.

The format of the minicpan command is

minicpan -l /path/to/your/local/minicpan-repository -r http://example.com/url/of/CPAN/mirror
like image 45
skiphoppy Avatar answered Oct 06 '22 01:10

skiphoppy