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

发布于 2024-07-10 03:40:09 字数 1071 浏览 10 评论 0原文

这是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫烠⑼条掵仅有一顆心 2024-07-17 03:40:09

这看起来很重要:

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

也许运行 sudo cpan,然后 o conf inito conf urllist push http://cpan.yahoo.com/ (例如)让您的 urllist 变得理顺? 然后尝试进行安装。

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? Then try to do your installs.

↘紸啶 2024-07-17 03:40:09

当您第一次使用 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 命令的格式为

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

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

minicpan -l /path/to/your/local/minicpan-repository -r http://example.com/url/of/CPAN/mirror
用心笑 2024-07-17 03:40:09

据猜测:

sudo perl -MCPAN -e "install YAML"

At a guess:

sudo perl -MCPAN -e "install YAML"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文