Antwort des Skripts auf apt-get-Anfrage "Um fortzufahren, geben Sie den Satz" Ja, so wie ich es sage! "In Bash ein

1503
Lennart Rolland

Mein Skript ersetzt sysvinit durch systemd innerhalb einer Chroot, während ein Debian-Image mit debootstrap erstellt wird.

Da dies eine "gefährliche" Aktion ist, wird apt-get eine dumme Frage stellen: "Um fortzufahren, tippen Sie den Satz" Ja, tun Sie, wie ich es sage! "

Wie kann ich die Antwort darauf schreiben?

EDIT: Ich habe alle -y - yes --force-yes-Optionen ausprobiert, aber sie funktionieren nicht.

3

2 Antworten auf die Frage

5
Ángel

Seltsamerweise scheint es sogar gefragt zu werden mit --force-yes:

apt-get remove -y --force-yes systemd 

Jedoch,

echo 'Yes, do as I say!' | apt-get remove systemd 

hat ordentlich gearbeitet.

0
lgaggini

apt-get hat einen -y, --yes, --assume-yesSchalter:

 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. 

oder alternativ einen --force-yesSchalter:

 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

Ich hätte sagen sollen, dass ich das getestet habe, aber es hat nicht funktioniert. wird Q aktualisieren. Lennart Rolland vor 8 Jahren 0
Ok, kein Problem, im Moment bin ich nicht auf einem Debian-basierten System, daher kann ich meine Lösung nicht alleine ausprobieren und erkennen, dass sie nicht funktioniert. lgaggini vor 8 Jahren 0