我如何告诉 CPAN 安装所有依赖项? [英] How do I tell CPAN to install all dependencies?
问题描述
如何告诉 CPAN 安装所有依赖项?
How do I tell CPAN to install all dependencies?
我尝试在 cpan
中设置这些:
I tried setting these in cpan
:
cpan> o conf prerequisites_policy follow
cpan> o conf commit
我仍然不得不多次回答y"(但感觉比以前少了).
I still had to answer "y" a couple of times (but fewer than before it feels like).
有没有办法让它始终继续安装?我想让它无人看管.
Is there a way to get it to always go ahead and install? I want to make it unattended.
似乎我想要一个标志总是相信 CPAN 做正确的事情,如果它提出了一个答案,我想遵循它(当它询问某些事情时总是按 Enter).
It would seem that I want a flag to always trust CPAN to do the right thing, and if it suggests an answer I would like to follow it (always hit Enter when it asks something).
推荐答案
这是使这些更改永久化的单行代码,包括自动首次 CPAN 配置:
Here is the one-liner making these changes permanent including automatic first-time CPAN configuration:
perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
或者将它与 local::lib
模块结合用于非特权用户:
Or combine it with local::lib
module for non-privileged users:
perl -MCPAN -Mlocal::lib=~/perl5 -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
在使用 CPAN shell 或其他任何东西之前运行它.
Run it before using the CPAN shell or whatever.
这篇关于我如何告诉 CPAN 安装所有依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!