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

Hi, Someone's managed to screw my default CPAN mirrors list and when I try to install a module, the CPAN agent gets stuck trying to connect to an unobtainable host. Can anybody advise how to..

a) Get my default list back

or
b) Do a clean install of CPAN

Gracias

Stew

Replies are listed 'Best First'.
Re: CPAN mirrors
by Aristotle (Chancellor) on Aug 10, 2004 at 11:52 UTC

    The documentation of CPAN says

    You can set and query each of these options interactively in the cpan shell with the command set defined within the o conf command:

    o conf <scalar option>
    prints the current value of the scalar option
    o conf <scalar option> <value>
    Sets the value of the scalar option to value
    o conf <list option>
    prints the current value of the list option in MakeMaker's neatvalue format.
    o conf <list option> [shift|pop]
    shifts or pops the array in the list option variable
    o conf <list option> [unshift|push|splice] <list>
    works like the corresponding perl commands.

    There's a list option called urllist which defines the CPAN mirrors the module will consult. Don't forget o conf commit to store your changes permanently.

    Makeshifts last the longest.

Re: CPAN mirrors
by borisz (Canon) on Aug 10, 2004 at 11:43 UTC
    use  o conf urllist push your_cpan_mirrors to add a mirror. And when finnised type o conf commit to save your changes.
    Boris
Re: CPAN mirrors
by gaal (Parson) on Aug 10, 2004 at 12:00 UTC
    In adition, if not only your mirror list is screwed, you can do o conf init to have all the original questions asked of you.

    If that doesn't work, try deleting ~/.cpan/CPAN/MyConfig.pm, or in extreme cases, the system-wide CPAN config file, which on Debian is located at /etc/perl/CPAN/Config.pm. YMMV.

    You can still download and install packages (including CPAN.pm itself) manually, e.g. by browsing http://search.cpan.org/, finding the module you want, and clicking Download. Then follow the standard untar-make-make test-make install procedure.

Re: CPAN mirrors
by stew (Scribe) on Aug 10, 2004 at 12:53 UTC
    Thanks guys, problem solved!