如何告诉 CPAN 安装所有依赖项? [英] How do I tell CPAN to install all dependencies?

查看:20
本文介绍了如何告诉 CPAN 安装所有依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆