2

Hi I am trying to install perl modules using cpanm.But my firewall is not letting the cpanm to use http. Even when I am forcing it to use https using the --mirror option, its still uses http to install the dependencies. How can i force cpanm to use only https://mirror-address .

Perl Version 5.16.3
Cpanm Version 1.6922
Pratheesh
  • 565
  • 4
  • 19

2 Answers2

5

From the documentation:

cpanm --from https://cpan.metacpan.org/ Plack    # use only the HTTPS mirror
Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • Hi @Steffen Ullrich . This method requires LWP::Protocol::https .Due to my firewall I can't install it through cpanm – Pratheesh Oct 25 '19 at 13:16
  • 1
    @xaglez: Then maybe you should get a Perl which has this already installed? There is nothing known about your system but on Windows there is strawberry Perl which includes all of this and on the various Linux distributions the necessary modules are also prepackaged and available through apt or rpm. Of course you can also download all of these modules with the browser and install these then locally. – Steffen Ullrich Oct 25 '19 at 13:22
  • 3
    @xaglez You can pass the --no-lwp option to force cpanm to use curl or wget which should be able to handle https. – Grinnz Oct 25 '19 at 14:23
  • HI @Steffen Ullrich i am using RHEL 7.7 Docker container – Pratheesh Oct 25 '19 at 15:33
  • 1
    @xaglez: there is an rpm for perl-LWP-Protocol-https – Steffen Ullrich Oct 25 '19 at 16:05
  • @xaglez, Feel free to download [LWP-Protocol-https](https://metacpan.org/release/LWP-Protocol-https) by some other means – ikegami Oct 25 '19 at 16:17
0

If you use Linux or Unix, try:

~$ echo "alias cpanm='cpanm --from https://cpan.metacpan.org/'" >> .bashrc
~$ source .bashrc
Legioneroff
  • 139
  • 5