gpt4 book ai didi

perl - 在 o conf init/proxy/之后使用带有代理的 CPAN 失败

转载 作者:行者123 更新时间:2023-12-03 01:49:10 25 4
gpt4 key购买 nike

我在企业环境中有一台 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'

知道我有一个代理可以导航,并阅读了网上有关代理和 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':

http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/

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 http://www.perl.org/CPAN/authors/01mailrc.txt.gz curl: (22) The requested URL returned error: 407

System call "/usr/bin/curl -L -f -s -S --netrc-optional "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" > /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 http://www.perl.org/CPAN/authors/01mailrc.txt.gz --2012-07-17 15:57:38-- http://www.perl.org/CPAN/authors/01mailrc.txt.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 Authentication Required 2012-07-17 15:57:38 ERROR 407: Proxy Authentication Required.

那么密码提示在哪里呢?

配置 cpan 通过具有身份验证的企业代理访问互联网时,我缺少什么?

最佳答案

您需要提供绝对代理 URL 地址来配置 CPAN 代理设置。不用担心,请按如下方式提供,而不是简单地提供 IP 地址和端口号。

cpan> o conf init /proxy/

Your ftp_proxy? [] ftp://10.12.8.9:3128

Your http_proxy? [] http://10.12.8.9:3128

Your no_proxy? []

并根据需要提供用户名密码(确保您具有下载权限)

我也有同样的问题,但现在它对我有用。我也应该为你工作。

BR杰里·詹姆斯

关于perl - 在 o conf init/proxy/之后使用带有代理的 CPAN 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11541428/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com