如何告诉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屋!