Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to configure the default mirror for App::cpanminus (cpanm)?

Tags:

I am aware you can easily configure cpan to use a specific mirror. However I recently started using cpanm at the advice of a friend, and I can't seem to find a way to set the default mirror without specifying --mirror http://cpan.metacpan.org on the command line each time.

Is there an environment variable or a config file that I can set the default mirror?

As for why I would want to simply not use the default list of mirrors, I am an FI and we are firewalled to no end. Only one mirror has been allowed through our firewall.

like image 895
Bill Avatar asked Dec 05 '17 20:12

Bill


1 Answers

Cite from the cpanm docs

ENVIRONMENT VARIABLES

PERL_CPANM_OPT If set, adds a set of default options to every cpanm command. These options come first, and so are overridden by command-line options.

So try: export PERL_CPANM_OPT="--mirror http://cpan.metacpan.org"

like image 167
jm666 Avatar answered Oct 11 '22 11:10

jm666