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

On launching CPAN i get the following error:

//----------------------------------------------------------------------------

user@austria:~$ sudo cpan Sorry, we have to rerun the configuration dialog for CPAN.pm due to so +me missing parameters. Configuration will be written to <</home/lampuser/.cpan/CPAN/MyConfig.pm>> CPAN.pm requires configuration, but most of it can be done automatical +ly. If you answer 'no' below, you will enter an interactive dialog for eac +h configuration option instead. Would you like to configure as much as possible automatically? [yes] Autoconfigured everything but 'urllist'. Now you need to choose your CPAN mirror sites. You can let me pick mi +rrors for you, you can select them from a list or you can enter them +by hand. Would you like me to automatically choose some CPAN mirror sites for y +ou? (This means connecting to the Internet) [yes] Looking for CPAN mirrors near you (please be patient) Can't call method "http" on unblessed reference at /usr/share/perl/5.1 +8/CPAN/FirstTime.pm line 1868.

//----------------------------------------------------------------------------



System details:

user@austria:~$ perl -V Summary of my perl5 (revision 5 version 18 subversion 2) configuration +: Platform: osname=linux, osvers=3.2.0-58-generic, archname=x86_64-linux-gnu-t +hread-multi uname='linux brownie 3.2.0-58-generic #88-ubuntu smp tue dec 3 17: +37:58 utc 2013 x86_64 x86_64 x86_64 gnulinux ' user@austria:~$ uname -a Linux austria 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC +2014 x86_64 x86_64 x86_64 GNU/Linux

//----------------------------------------------------------------------------

Replies are listed 'Best First'.
Re: CPAN error on first run
by marto (Cardinal) on Sep 28, 2015 at 14:27 UTC

    If you are simply interested in making this work try entering no at the folowing prompt:

    Would you like me to automatically choose some CPAN mirror sites for you? (This means connecting to the Internet) [yes] <-- enter + no here

    And continue on from there. Manually pick a mirror from the list presented. Another option would be to switch to cpanm. If you're interested in debugging this problem start by looking at the line number displayed in the error, and work back from there.

    Update: also please follow the formatting advice when posting, SoPW.

Re: CPAN error on first run
by stevieb (Canon) on Sep 28, 2015 at 14:32 UTC

    I just quickly reviewed a few Google'd results for this issue, and it seems it's related to not being able to find a mirror candidate (possibly due to networking issue?).

    First, ensure that your network is up and ok. ping 8.8.8.8, dig perlmonks.org. After that, and it still doesn't work, try answering "no" to "Would you like me to automatically choose some CPAN mirror sites for you?", then, go to CPAN sites, and enter some in manually.

    Let us know if this works out for you.

    -stevieb

    Update: Do you need to go through a proxy? If so, and you haven't configured CPAN to do so, this would cause the error you're seeing as well.

      network is ok

      configured to go through a proxy and CPAN is also configure for the proxy.

      Finally realised that a colleague had installed CPANMinus and this works flawlessly.

      Could this be the issue CPAN and CPANMinus (cpanm) can't be installed concurrently?

        Could this be the issue CPAN and CPANMinus (cpanm) can't be installed concurrently?

        No