Change your default CPAN mirror



Changing your cpan mirror.

Although it seems like it would be easy task to accomplish, it seems there is no easy way to change the perl CPAN module mirror list. I have only found two ways to do this.

The first way I found is to modify your Config.pm in the CPAN module. In my install, it is located at /usr/lib/perl5/5.8.5/CPAN/Config.pm. Look for ‘urllist’ and you will see the list of mirrors. Modify this variable to change where CPAN looks for its modules.

The second way is to re-run the CPAN configuration. You do this by running the cpan command line:

1
perl -MCPAN -e shell

and then running o conf init

1
cpan> o conf init

This will run the initial configuration of CPAN again.

It seems like there should be an easier way to do this – if anyone knows please post a comment!

  • Dustin

    o conf urllist
    o conf urllist push http://ftp.wayne.edu/cpan/
    o conf urllist commit

    Other commands

    o conf urllist shift
    o conf urllist pop

  • Dustin

    o conf urllist
    o conf urllist push http://ftp.wayne.edu/cpan/
    o conf urllist commit

    Other commands

    o conf urllist shift
    o conf urllist pop

  • james

    the problem with the second option is that if you’re changing your CPAN mirror because the old one isn’t working, it won’t succeed in getting the list of mirrors since it tries to get them from your current mirror.

  • james

    the problem with the second option is that if you’re changing your CPAN mirror because the old one isn’t working, it won’t succeed in getting the list of mirrors since it tries to get them from your current mirror.

  • Minor correction to # 01 above:

    o conf urllist commit

    SHOULD BE

    o conf commit

  • Minor correction to # 01 above:

    o conf urllist commit

    SHOULD BE

    o conf commit

  • zaki

    thanks it worked for me.

  • zaki

    thanks it worked for me.

  • Pingback: tsuno.be » CPAN Mirror()

  • Apoorv Sharma

    Thanks a lot!

    saved a life… :)

  • Apoorv Sharma

    Thanks a lot!

    saved a life… :)

  • Pingback: Puddles MythTV()

  • laurens

    Great, was really looking for these options