!!!障害 *proxy プロキシ設定が必要な環境 *RHEL-7 で cpan を利用しようとして cpan の初期設定時にエラーが発生し終了する。 RHEL7# cpan ...中略... Would you like me to automatically choose some CPAN mirror sites for you? (This means connecting to the Internet) [yes] yes Looking for CPAN mirrors near you (please be patient) Can't call method "http" on unblessed reference at /usr/share/perl5/CPAN/FirstTime.pm line 1866. RHEL7# !推測 *初期のURL判定ができないため終了する。 *正しいURLを提供すると初期化できる。 !解消できなかった対応 #1 *perl-CPAN ダウングレード yum downgrade perl-CPAN *perl-CPAN-1.9800-299.el7_9.noarch *perl-CPAN-1.9800-297.el7.noarch *perl-CPAN-1.9800-283.el7.noarch !解消できた対応法 *環境変数の設定 export http_proxy=http://proxy.example.com:8080/ *環境変数を設定したが不要かも? export https_proxy=http://proxy.example.com:8080/ *cpan 実行 RHEL7# 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. *cpan 初期設定を可能な限り自動設定するかの質問には <> を入力 Would you like to configure as much as possible automatically? [yes] no *途中まではデフォルトの設定を入力 *http_proxy では環境変数の設定値が反映されている。そのまま Enter 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? [http://proxy.example.com:8080/] *cpan サイト一覧をダウンロードするか、で標準は yes となっているが <> を入力 If you have never defined your own C in your configuration then C will be hesitant to use the built in default sites for downloading. It will ask you once per session if a connection to the internet is OK and only if you say yes, it will try to connect. But to avoid this question, you can choose your favorite download sites once and get away with it. Or, if you have no favorite download sites answer yes to the following question. If no urllist has been chosen yet, would you prefer CPAN.pm to connect to the built-in default sites without asking? (yes/no)? [yes] no *自動で CPAN ミラーサイトを選択するか、で標準は yes となっているが <> を入力 Now you need to choose your CPAN mirror sites. You can let me pick mirrors for you, you can select them from a list or you can enter them by hand. Would you like me to automatically choose some CPAN mirror sites for you? (This means connecting to the Internet) [yes] no *CPAN ミラーサイト一覧から選択するか、で標準は yes となっているが <> を入力 Would you like to pick from the CPAN mirror list? [yes] no *手動で CPAN URL を入力する。 Now you can enter your own CPAN URLs by hand. A local CPAN mirror can be listed using a 'file:' URL like 'file:///path/to/cpan/' CPAN.pm needs at least one URL where it can fetch CPAN files from. *ブラウザで確認した http://ftp.kddilabs.jp/CPAN/ を入力 Please enter your CPAN site: [] http://ftp.kddilabs.jp/CPAN/ *他に入力するものが無ければ Enter だけを入力 Enter another URL or ENTER to quit: [] *入力が終わったら CPAN の URL リストが確認表示される。 New urllist http://ftp.kddilabs.jp/CPAN/ *以降、CPAN の自動設定が完了し、$HOME/.cpan/CPAN/MyConfig.pm にファイルが作成された。 */root/.cpan/CPAN/MyConfig.pm $CPAN::Config = { 'applypatch' => q[], 'auto_commit' => q[0], ...以下略