Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

How to reset cpan to default values

by xorl (Deacon)
on Jun 10, 2012 at 14:41 UTC ( #975452=perlquestion: print w/replies, xml ) Need Help??

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

So I configured cpan to use an internal company mirror. However now I want to reset it back to default values. (and no I don't remember how I got this whacked configuration, except I did it all from the cpan shell)

I tried first:

o conf init urllist

However it looks to the internal company mirror for the MIRROR.BY list. That of course only lists the inside and it never gives me the option of choosing North America or anything after that.

Then I decided to try to reset everything with

o conf init

However when it gets to doing stuff related to the Internet it again only looks to our internal server.

Short of removing and reinstalling cpan is there some way to reset it to the originial default values?

Thanks in advance.

Replies are listed 'Best First'.
Re: How to reset cpan to default values
by stevieb (Canon) on Jun 10, 2012 at 17:07 UTC

    I just did a test (on Ubuntu 11.10). I went into /etc/perl/CPAN directory, moved to, then re-ran perl -MCPAN -e shell and it offered me the ability to redo the original setup.

    Hope this helps.

Re: How to reset cpan to default values
by ansh batra (Friar) on Jun 10, 2012 at 20:10 UTC

    you can delete /etc/perl/CPAN/ and then try perl -MCPAN -e shell

      Thanks this almost worked. It got me on track of trying to figure out where cpan kept its config stuff.

      There was something in $HOME/.cpan/CPAN/ that was setting the urllist and making it impossible to download the MIRRORED.BY file from a real cpan mirror. I removed it and magic happened.

        one more thing.take the backup of and if you want to do some minor changes in Ur CPAN configuration then simply edit which is easier than typing commands on Ur CPAN shell.
        eg if u want to add some URL then it is much easier and faster to edit the file

Re: How to reset cpan to default values
by DrHyde (Prior) on Jun 13, 2012 at 10:53 UTC
    $ perl -MCPAN -e shell ... cpan[1]> o conf urllist http://moonbeast.wibble.poing
    will set it to whatever you like. If you want to point it at the default set of mirrors, use, which will pick a nearby mirror for you automagically.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-05-28 19:21 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (101 votes). Check out past polls.