This is actually a rant based on recent frustration. It also includes the answer, so I don't have a question but am instead posting the Q&A so it's here and findable via search.

To begin, I posted the following on <mumble mumble/>:

I have a Linux box in a corporate environment in which web access is gated through a proxy which requires authentication.
 
During a first run of cpan it auto configures everything that it normally does:

Autoconfigured everything but 'urllist'. Please call 'o conf init +urllist' to configure your CPAN server(s) now! commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

Knowing that I have a proxy to navigate, and having read the docs and several pages on the web about proxy and cpan I:

cpan[1]> o conf init /proxy/ If you're accessing the net via proxies, you can specify them in t +he CPAN configuration or via environment variables. The variable in t +he $CPAN::Config takes precedence. Your ftp_proxy? [] Your http_proxy? [] 10.12.8.9:3128 Your no_proxy? [] If your proxy is an authenticating proxy, you can store your usern +ame permanently. If you do not want that, just press RETURN. You will + then be asked for your username in every future session. Your proxy user id? [] my_net_id Your password for the authenticating proxy can also be stored perm +anently on disk. If this violates your security policy, just press RE +TURN. You will then be asked for the password in every future session +. CPAN: Term::ReadKey loaded ok (v2.30) Your proxy password? Please +remember to call 'o conf commit' to make the config permanent! cpan[2]> o conf commit commit: wrote '/usr/lib/perl5/5.10.0/CPAN/C +onfig.pm'

All should be good now, right? So I wish,

cpan[3]> i /Some::Module/ CPAN: Storable loaded ok (v2.18) I would like to connect to one of the following sites to get 'auth +ors/01mailrc.txt.gz': http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/ Is it OK to try to connect to the Internet? [yes] LWP not availabl +e Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get ht +tp://www.perl.org/CPAN/authors/01mailrc.txt.gz curl: (22) The request +ed URL returned error: 407 System call "/usr/bin/curl -L -f -s -S --netrc-optional "http://ww +w.perl.org/CPAN/authors/01mailrc.txt.gz" > /root/.cpan/sources/author +s/01mailrc.txt.tmp29726" returned status 22 (wstat 5632) Warning: exp +ected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726] doe +sn't exist Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc +.txt.tmp29726" to get http://www.perl.org/CPAN/authors/01mailrc.txt.g +z --2012-07-17 15:57:38-- http://www.perl.org/CPAN/authors/01mailrc.t +xt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent, +awaiting response... 301 Moved Permanently Location: http://www.cpan. +org/authors/01mailrc.txt.gz [following] --2012-07-17 15:57:38-- http: +//www.cpan.org/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128.. +. connected. Proxy request sent, awaiting response... 407 Proxy Authe +ntication Required 2012-07-17 15:57:38 ERROR 407: Proxy Authenticatio +n Required.

So where's the password prompt?
What am I missing to configure cpan to access the internet through the corporate proxy with authentication?

Perhaps you've been here also: new box, proxy to navigate through, check the internet to review and confirm how to configure cpan to navigate the proxy, and then ... failure.

Here is the solution: install LWP

But wait, isn't that a module you'd normally install with cpan or cpanplus or cpanminus? Yeah it is. It's time to get old school and download and install by hand.

Before you go there, LWP has a few dependencies. The complete kit you will need is:

Compress-Raw-Bzip2-2.049.tar.gz Compress-Raw-Zlib-2.051.tar.gz Digest-MD5-2.51.tar.gz Encode-Locale-1.03.tar.gz HTML-Form-6.02.tar.gz HTML-Parser-3.69.tar.gz HTML-Tagset-3.20.tar.gz HTTP-Cookies-6.01.tar.gz HTTP-Date-6.01.tar.gz HTTP-Message-6.03.tar.gz HTTP-Negotiate-6.01.tar.gz IO-Compress-2.049.tar.gz libnet-1.22.tar.gz libwww-perl-6.04.tar.gz LWP-MediaTypes-6.02.tar.gz MIME-Base64-3.13.tar.gz Net-HTTP-6.03.tar.gz URI-1.59.tar.gz WWW-RobotRules-6.02.tar.gz
The sequence of what needs to be installed in what order is left as an exercise for the reader.


Be Appropriate && Follow Your Curiosity

In reply to Base install Perl - getting cpan to work through proxy authentication by mikeraz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.