【发布时间】:2017-07-27 17:59:02
【问题描述】:
我需要通过代理运行 cpan,但是当我尝试配置时出现错误并且第一次无法进入 cpan
root@srv-linux01:~# cpan
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes] no
关于代理设置:
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.
<ftp_proxy>
Your ftp_proxy? [] http://username:password@proxyIP:Port/ <---- is ok the information?
<http_proxy>
Your http_proxy? [] http://username:password@proxyIP:Port/ <---- is ok the information?
<no_proxy>
Your no_proxy? []
If your proxy is an authenticating proxy, you can store your username
permanently. If you do not want that, just press ENTER. You will then
be asked for your username in every future session.
Your proxy user id? [] <---- username is needed again?
Your password for the authenticating proxy can also be stored
permanently on disk. If this violates your security policy, just press
ENTER. You will then be asked for the password in every future
session.
Your proxy password?
在此之前我明白了。
Fetching with HTTP::Tiny:
http://www.perl.org/CPAN/MIRRORED.BY.gz
Error downloading with HTTP::Tiny: Not a CODE reference at /usr/share/perl/5.18/CPAN/HTTP/Client.pm line 112, <STDIN> line 65.
我使用的是 Ubuntu Server 14.04 LTS 和 Perl 5.18.2
谢谢
【问题讨论】:
-
...您是否尝试过将代理配置指定为只是一个 URL,并分别给用户/通行证?
-
喜欢你的 ftp_proxy? []ipaddress:port你的http_proxy? [] ipaddress:port 和用户并通过之前?是的,我也一样……
-
你不能像这样使用 CPAN 安装:
export http_proxy=http://httpproxy.test.com:8080/; export https_proxy=$http_proxy -
嗨 AbhiNickz 我明白了;使用 HTTP::Tiny 获取:perl.org/CPAN/MIRRORED.BY.gz 使用 HTTP::Tiny 下载时出错:不是 /usr/share/perl/5.18/CPAN/HTTP/Client.pm 第 112 行,
第 2 行的代码参考。跨度>