Linux 如何更新 CPAN perl 模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19677296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:14:04  来源:igfitidea点击:

How to update CPAN perl module

linuxperlcpan

提问by MENTAL

I'm trying to install some perl module but everytime this message is shown

我正在尝试安装一些 perl 模块,但每次显示此消息时

  New CPAN.pm version (v2.00) available.
  [Currently running version is v1.960001]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.

I've tried to do

我试过做

install CPAN
reload cpan

With

pi@raspbmc:~$ sudo perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.960001)
Enter 'h' for help.

cpan[1]> install CPAN

But the result is

但结果是

Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Mon, 28 Oct 2013 23:41:06 GMT
  HTTP::Date not available
  ..............
  New CPAN.pm version (v2.00) available.
  [Currently running version is v1.960001]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...............pi@raspbmc:~$ 

The version is still 1.960001.

版本还是1.960001。

采纳答案by Vorsprung

  1. download CPAN module from this page http://metacpan.org/pod/CPAN

  2. untar it (tar zxf CPAN-2.00.tar.gz), cd into the directory and run

    perl Makefile.PL
    make test
    sudo make install
    
  1. 从这个页面下载 CPAN 模块http://metacpan.org/pod/CPAN

  2. 解压它 ( tar zxf CPAN-2.00.tar.gz), cd 进入目录并运行

    perl Makefile.PL
    make test
    sudo make install
    

edit: if it breaks making a path with :: in it then perhaps your filesystem type does not support these characters in a filename

编辑:如果它破坏了用 :: 在其中创建路径,那么您的文件系统类型可能不支持文件名中的这些字符

To see the filesystem type, run mountwithout any parameters and all the mounted filesystems with their types will be shown

要查看文件系统类型,mount不带任何参数运行,将显示所有已挂载的文件系统及其类型

The error Can't write-open blib/man3/CPAN::Admin.3pmseems to suggest a filesystem problem, but ext4 in rw mode sounds alright. Try this from the CPAN-2.00directory

该错误Can't write-open blib/man3/CPAN::Admin.3pm似乎表明存在文件系统问题,但 rw 模式下的 ext4 听起来不错。从CPAN-2.00目录中试试这个

perl -e 'open($f,">blib/man3/CPAN::thisisatest") || die $!;'

回答by honzakuzel1989

The following procedure

以下程序

  1. kuz1@banana:~$ sudo perl -MCPAN -e shell
  2. cpan[1]> install CPAN
  3. cpan[2]> reload cpan
  1. kuz1@banana:~$ sudo perl -MCPAN -e shell
  2. cpan[1]> install CPAN
  3. cpan[2]> reload cpan

works for me on the BANANA Pi Single-Board Computer with Ubuntu 14.04.

在装有 Ubuntu 14.04 的 BANANA Pi 单板计算机上为我工作。