Strangely, it seems asked even with --force-yes
:
apt-get remove -y --force-yes systemd
However,
echo 'Yes, do as I say!' | apt-get remove systemd
worked neatly.
Мой скрипт заменяет sysvinit на systemd внутри chroot при создании образа debian с помощью debootstrap.
Поскольку это «опасное» действие, apt-get задаст глупый вопрос: «Для продолжения введите фразу« Да, делай, как я говорю! »
Как я могу написать ответ на этот вопрос?
РЕДАКТИРОВАТЬ: Я попробовал все варианты -y --yes --force-yes, но они не работают.
Strangely, it seems asked even with --force-yes
:
apt-get remove -y --force-yes systemd
However,
echo 'Yes, do as I say!' | apt-get remove systemd
worked neatly.
apt-get has a -y, --yes, --assume-yes
switch:
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. Configuration Item: APT::Get::Assume-Yes.
or, in alternative a --force-yes
switch:
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
http://manpages.ubuntu.com/manpages/utopic/man8/apt-get.8.html