perl – 使用CPAN与代理在o conf init / proxy /

前端之家收集整理的这篇文章主要介绍了perl – 使用CPAN与代理在o conf init / proxy /前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在公司环境中有一个Linux盒子,通过一个需要身份验证的代理来访问Web访问.

在第一次运行cpan时,它会自动配置它通常执行的所有操作:

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’

知道我有一个代理浏览,并阅读了关于proxy和cpan的文档和网页上的几个页面

cpan[1]> o conf init /proxy/

If you’re accessing the net via proxies,you can specify them in the
CPAN configuration or via environment variables. The variable in the
$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 username
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
permanently on disk. If this violates your security policy,just press
RETURN. 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/Config.pm’

现在都应该好,对吧?
所以我希望

cpan[3]> i /Some::Module/
CPAN: Storable loaded ok (v2.18)

I would like to connect to one of the following sites to get
‘authors/01mailrc.txt.gz’:

07000 07001

Is it OK to try to connect to the Internet? [yes] LWP not available

Trying with “/usr/bin/curl -L -f -s -S –netrc-optional” to get
07002 curl: (22) The requested URL returned error: 407

System call “/usr/bin/curl -L -f -s -S –netrc-optional
“07002” >
/root/.cpan/sources/authors/01mailrc.txt.tmp29726″
returned status 22 (wstat 5632) Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726] doesn’t exist

Trying with “/usr/bin/wget -O
/root/.cpan/sources/authors/01mailrc.txt.tmp29726” to get
07002
–2012-07-17 15:57:38– 07002 Connecting to
10.12.8.9:3128… connected. Proxy request sent,awaiting response… 301 Moved Permanently Location:
07006 [following]
–2012-07-17 15:57:38– 07006 Connecting to 10.12.8.9:3128… connected. Proxy request sent,
awaiting response… 407 Proxy Authentication required
2012-07-17 15:57:38 ERROR 407: Proxy Authentication required.

那么密码提示在哪里?

缺少配置cpan通过身份验证访问公司代理的互联网?

解决方法

安装LWP. cpan实用程序正在使用curl,我猜是因为它无法加载LWP.没有代理参数传递给curl,所以在运行命令之前需要导出http_proxy = http:// host:port /.

或者,如果您可以使用发行版的软件包管理器安装LWP,则应正确配置代理访问.

原文链接:https://www.f2er.com/Perl/172757.html

猜你在找的Perl相关文章