star870126 发表于 2018-9-1 07:28:48

解决perl模块无法安装的问题

  rm /usr/lib/perl5/5.8.8/CPAN/Config.pm
  perl -MCPAN -e shell
  在安装PERL模块的时候,遇到下面的问题导致无法安装perl模块,具体错误信息如下:
  cpan> install Getopt::Long
  .........
  ...........
  Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
  Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
  Please check the validity of the index file by comparing it to more
  than one CPAN mirror. I'll continue but problems seem likely to
  happen.
  Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
  原因是由于cpan模块中的数据损坏造成。
  解决方法:
  1,删除用户主目录下面的pan目录
  rm -rf ~/.cpan
  2,执行perl -MCPAN -e shell命令,输入:
  reload index
  3,安装此模块:
  install Bundle::CPAN
  4,最后执行
  reload CPAN
  这样即可正常通过命令行 install MODULES 模块的正常安装了。

页: [1]
查看完整版本: 解决perl模块无法安装的问题