简体   繁体   English

我如何告诉CPAN.pm在哪里获取模块?

[英]How do I tell CPAN.pm where to get modules?

Here is the complete install command to CPAN and the output: 以下是CPAN的完整安装命令和输出:

sudo perl -MCPAN -e "install Bundle::CPAN"
CPAN: Storable loaded ok (v2.13)
Going to read /home/delgreco/.cpan/Metadata
  Database was generated on Mon, 08 Dec 2008 03:27:10 GMT
CPAN: LWP::UserAgent loaded ok (v2.033)
CPAN: Time::HiRes loaded ok (v1.55)
CPAN: YAML loaded ok (v0.39)
Warning: YAML version '0.39' is too low, please upgrade!
I'll continue but problems are *very* likely to happen.
Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist
push ftp://myurl/'

Could not fetch authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz
Giving up on '/home/delgreco/.cpan/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz'
Note: Current database in memory was generated on Mon, 08 Dec 2008 03:27:10 GMT

        ...propagated at /usr/lib/perl5/5.8.5/CPAN.pm line 3417.

This worked for me, thanks... 这对我有用,谢谢......

cpan> o conf urllist http://cpan.yahoo.com/ cpan> o conf urllist http://cpan.yahoo.com/

Of course, the Bundle::CPAN install proceeded to fail on other dependencies, but at least I have a YAML 0.68 now. 当然,Bundle :: CPAN安装在其他依赖项上继续失败,但至少我现在有一个YAML 0.68。

This looks important: 这看起来很重要:

Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'

Perhaps run sudo cpan , then o conf init or o conf urllist push http://cpan.yahoo.com/ (for example) to get your urllist straightened out? 也许运行sudo cpan ,然后o conf inito conf urllist push http://cpan.yahoo.com/ (例如)让你的urllist理顺? Then try to do your installs. 然后尝试进行安装。

When you first used the CPAN module, you were asked something along the lines of "Are you ready to proceed with interactive configuration?" 当您第一次使用CPAN模块时,您会被问到“您准备好继续进行交互式配置吗?” You probably answered "no." 你可能回答“不”。 Default configuration options were selected, and so no CPAN repository mirrors were configured for you to pull module tarballs from. 已选择默认配置选项,因此未配置任何CPAN存储库镜像以从中提取模块tarball。

As others have noted, you can configure that option with the o conf urllist command inside the CPAN shell. 正如其他人所说,您可以使用CPAN shell中的o conf urllist命令配置该选项。

My personal preference is to create a "miniCPAN," a local repository that basically contains the latest version of each module (much smaller than pulling ALL of CPAN, which would contain many out of date versions of each module). 我个人的偏好是创建一个“miniCPAN”,一个本地存储库,基本上包含每个模块的最新版本(远小于拉动所有CPAN,其中包含每个模块的许多过时版本)。 To do this, configure a CPAN mirror repository to use temporarily, install the CPAN::Mini module from it, then use the minicpan command-line program which will be installed to create your repository. 为此,请将CPAN镜像存储库配置为临时使用,从中安装CPAN :: Mini模块,然后使用将安装的minicpan命令行程序来创建存储库。 Now use o conf urllist pop to remove the CPAN mirror you configured, and o conf urllist push file:///path/to/your/minicpan to tell the CPAN module to install from your local mirror from now on. 现在使用o conf urllist pop来删除你配置的CPAN镜像,并且配置文件:/// path / to / your / minicpan告诉CPAN模块从现在开始从本地镜像安装。 You can put the minicpan command in cron to update regularly, or just run it from the command-line whenever you want to refresh. 您可以将minicpan命令放在cron中定期更新,或者只要您想刷新就从命令行运行它。

The format of the minicpan command is minicpan命令的格式是

minicpan -l /path/to/your/local/minicpan-repository -r http://example.com/url/of/CPAN/mirror

猜测:

sudo perl -MCPAN -e "install YAML"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM