Getting "Proxy authentication Required" message while installing a perl module from CPAN

StackOverflow https://stackoverflow.com/questions/22534444

  •  18-06-2023
  •  | 
  •  

Question

I'm trying to install a Perl module (JSON) from CPAN but getting below error.

root@catspc:/etc/apt# cpan

cpan shell -- CPAN exploration and modules installation (v1.960001)
Enter 'h' for help.

cpan[1]> install JSON
Going to read '/root/.cpan/Metadata'
  Database was generated on Sat, 07 Dec 2013 22:53:04 GMT
Fetching with LWP:
http://mirror.sov.uk.goscomb.net/CPAN/authors/01mailrc.txt.gz

Proxy authentication needed!
 (Note: to permanently configure username and password run
   o conf proxy_user your_username
   o conf proxy_pass your_password
     )
Username:  vc06
Password:  

Catching error: "Undefined subroutine &CPAN::HTTP::Credentials::_clear_non_proxy_credentials called at /usr/share/perl/5.14/CPAN/HTTP/Credentials.pm line 10, <STDIN> line 2.\cJ" at /usr/share/perl/5.14/CPAN.pm line 391
    CPAN::shell() called at /usr/share/perl/5.14/App/Cpan.pm line 295
    App::Cpan::_process_options('App::Cpan') called at /usr/share/perl/5.14/App/Cpan.pm line 364
    App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11
Fetching with LWP:
http://mirror.sov.uk.goscomb.net/CPAN/authors/01mailrc.txt.gz
Lockfile removed.
Undefined subroutine &CPAN::HTTP::Credentials::_clear_non_proxy_credentials called at /usr/share/perl/5.14/CPAN/HTTP/Credentials.pm line 10, <STDIN> line 2.
root@catspc:/etc/apt#

Could someone help me in fixing this issue? What went wrong here?

Awaiting your valuable reply.

Was it helpful?

Solution

Chances are your cpan configuration is skewed.

Is there a reason why you dont use cpanm? (https://metacpan.org/release/App-cpanminus)

I switched from cpan to cpanm some years ago and havent regretted it yet.

DESCRIPTION

cpanminus is a script to get, unpack, build and install modules from CPAN and does nothing else.

It's dependency free (can bootstrap itself), requires zero configuration, and stands alone. When running, it requires only 10MB of RAM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top