2017-03-07 11 views
3

私はCPANトラフプロキシを実行する必要がありますが、私は設定しようとすると、私はエラーを持って、初めてCPANにプロキシ設定でCPAN最初の打ち上げ(プロキシ構成)

[email protected]:~# 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:[email protected]:Port/ <---- is ok the information? 

<http_proxy> 
Your http_proxy? [] http://username:[email protected]: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

おかげ

+0

...プロキシ設定を単なるURLとして指定し、ユーザ/パスを別々に指定してみましたか? – Sobrique

+0

ように あなたのftp_proxy? [] http:// ipaddress:port/ http_proxy? [] http:// ipaddress:port/ と前にパスしますか?はい、私は同じものを得ます... –

+0

このようにCPANをインストールすることはできません: 'export http_proxy = http://httpproxy.test.com:8080 /;エクスポートhttps_proxy = $ http_proxy' – AbhiNickz

答えて

1

を使用。

This SO answerは、おそらくLWP(およびその18個の依存関係)をインストールすると問題が改善されることを示唆しています。まあ、私はそれに頼る必要はなかったのでうれしいです。私はこれを持っていた

問題は、私はすでに私の環境ではhttp_proxyhttps_proxy、および設定(およびエクスポート)これらの両方の大文字のバージョンを持っていたことでした。これらの環境変数が存在する場合、その他のプログラム(wgetおよびcurlを含む)はうまく動作します。これらを再度設定する必要はありませんでした。まだのCPANが失敗した場合は、が明らかになったときにwget

は最終的に私ののために動作しなかった何を空の文字列にCPAN http_proxyコンフィグ設定を設定し、指示hereに従うことでした。 (私も以前に手編集~/.cpan/CPAN/MyConfig.pmにより、プロキシのユーザー名とパスワードの設定を削除していた。)

$ cpan # or perl -MCPAN -e shell 
cpan[1]> o conf http_proxy "" 
cpan[2]> o conf ftp_proxy "" 
cpan[3]> o conf proxy_user "" 
cpan[4]> o conf proxy_pass "" 
cpan[5]> o conf commit 
cpan[6]> q 

$ # I have a shell function that does basically this 
$ export http_proxy="http://user:[email protected]:8080" 
$ for v in HTTP_PROXY https_proxy HTTPS_PROXY ftp_proxy FTP_PROXY; do 
> export $v="$http_proxy" 
> done 

$ cpan i Devel::Repl # or whatever 

はその後、おそらく、wgetだけで、もちろん正常に動作しますcpanを呼び出す前に定義された環境変数を使用していました。認証が必要なプロキシがある場合、Arch wikiのthis articleには、資格情報を求めるプロンプトが表示され、適切な*_proxy*_PROXYの環境変数をすべて設定します。

公告のとおり、重要なパスワードをプレーンテキストの設定ファイルまたは~/.bashrcに入れないでください。

関連する問題