Perl CPAN::Modulelist的解決辦法

來源:互聯網
上載者:User

今天用CPAN安裝Term::ReadLine,報了個這樣的錯誤

Going to read /root/.cpan/sources/modules/03modlist.data.gz
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 31) line 1.
at /usr/lib/perl5/5.8.5/CPAN.pm line 3406
CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/lib/perl5/5.8.5/CPAN.pm line 3129
CPAN::Index::reload('CPAN::Index') called at /usr/lib/perl5/5.8.5/CPAN.pm line 675
CPAN::exists('CPAN=HASH(0x9c79658)', 'CPAN::Module', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 1842
CPAN::Shell::expandany('CPAN::Shell', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 2078
CPAN::Shell::rematein('CPAN::Shell', 'install', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 2165
CPAN::Shell::install('CPAN::Shell', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 201 eval {...} called at /usr/lib/perl5/5.8.5/CPAN.pm line 201 CPAN::shell() called at -e line 1

google結果有人是這樣解決的

rm -rf ~/.cpan
刪除後在perl -MCPAN -e shell中執行reload index
然後執行install Bundle::CPAN
最後執行reload CPAN即可正常通過命令列install MODULES

我按照這個做,結果reload index執行都報錯,繼續google,發現應該是Config.pm的問題,重新設定

cpan> o conf urllist unshift http://www.perl.com/CPAN/
cpan> o conf commit

然後再執行上面的reload index之後的步驟就OK了。

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.