apt-get:如何绕过按 ENTER

Col*_*amp 6 linux shell circleci ubuntu-16.04

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

Phi*_*ark 15

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

您可以使用-y/--yes标志来规避它。请参阅联机帮助页

例如这样:

sudo add-apt-repository --yes ppa:example/repository
Run Code Online (Sandbox Code Playgroud)


JNe*_*ill 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.
Run Code Online (Sandbox Code Playgroud)

所以...买者自负

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

APT::Get::Assume-Yes "true";
APT::Get::force-yes "true";
Run Code Online (Sandbox Code Playgroud)