我如何告诉 CPAN.pm 从哪里获取模块?
这是 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.
这对我有用,谢谢......
cpan> o 配置 urllist http://cpan.yahoo.com/
当然,Bundle::CPAN 安装在其他设备上失败了依赖项,但至少我现在有一个 YAML 0.68。
Here is the complete install command to CPAN and the output:
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/
Of course, the Bundle::CPAN install proceeded to fail on other dependencies, but at least I have a YAML 0.68 now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这看起来很重要:
也许运行
sudo cpan
,然后o conf init
或o conf urllist push http://cpan.yahoo.com/
(例如)让您的urllist
变得理顺? 然后尝试进行安装。This looks important:
Perhaps run
sudo cpan
, theno conf init
oro conf urllist push http://cpan.yahoo.com/
(for example) to get yoururllist
straightened out? Then try to do your installs.当您第一次使用 CPAN 模块时,系统会询问您类似“您准备好继续进行交互式配置了吗?”的问题。 你可能会回答“不”。 选择了默认配置选项,因此没有配置 CPAN 存储库镜像供您从中提取模块 tarball。
正如其他人所指出的,您可以使用 CPAN shell 内的 o conf urllist 命令配置该选项。
我个人的偏好是创建一个“miniCPAN”,一个本地存储库,基本上包含每个模块的最新版本(比拉取所有 CPAN 小得多,其中包含每个模块的许多过时版本)。 为此,请配置临时使用的 CPAN 镜像存储库,从中安装 CPAN::Mini 模块,然后使用将安装的 minicpan 命令行程序来创建存储库。 现在使用 o conf urllist pop 删除您配置的 CPAN 镜像,并使用 o conf urllist push file:///path/to/your/minicpan 告诉 CPAN 模块从现在开始从您的本地镜像安装。 您可以将 minicpan 命令放在 cron 中定期更新,或者只要想刷新就从命令行运行它。
minicpan 命令的格式为
When you first used the CPAN module, you were asked something along the lines of "Are you ready to proceed with interactive configuration?" You probably answered "no." Default configuration options were selected, and so no CPAN repository mirrors were configured for you to pull module tarballs from.
As others have noted, you can configure that option with the o conf urllist command inside the CPAN shell.
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). 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. 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. You can put the minicpan command in cron to update regularly, or just run it from the command-line whenever you want to refresh.
The format of the minicpan command is
据猜测:
At a guess: