apt-get:如何绕过按ENTER键

时间:2017-08-07 14:03:08

标签: linux shell ubuntu-16.04 circleci

我在CircleCI中使用Press [ENTER] to continue or ctrl-c to cancel adding it时得到apt-get。 如何自动绕过它?
我尝试使用-y但没有效果!

2 个答案:

答案 0 :(得分:2)

也许您可以考虑--force-yes标志。从联机帮助页:

--force-yes
       Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should not be
       used except in very special situations. Using force-yes can potentially destroy your system! Configuration Item: APT::Get::force-yes.

所以...警告经纪人

您也可以使这些标志永久化。在/etc/apt/apt.conf.d/中创建一个文件,例如/etc/apt/apt.conf.d/90_no_prompt,其中包含以下内容:

APT::Get::Assume-Yes "true";
APT::Get::force-yes "true";

答案 1 :(得分:1)

此消息源于对add-apt-repository的调用。

您可以使用-y / --yes标记绕过它。见the manpage

例如:

sudo add-apt-repository --yes ppa:example/repository