Existem duas maneiras de fazer isso:
Apt-get specific:
$man apt-get
[...]
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts
and run non-interactively. If an undesirable situation,
such as changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will abort.
[...]
--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!
Geral: o comando yes
:
$man yes
yes - output a string repeatedly until killed [...]
DESCRIPTION
Repeatedly output a line with all specified STRING(s), or 'y'.
Como yes
não pode saber nada sobre apt-get
internals, provavelmente é equivalente a --force-yes
e, portanto, dangerous . Se você ainda quiser fazer isso, canalize a saída de yes
para apt-get
:
yes | apt-get update