I am trying to write a non-interactive system update script.
if the following works well:
yes | dpkg --configure -a
will the following work also very well?:
yes | apt-get install --fix-broken
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
--assume-yes parameters in
Try something like
sudo apt-get install -y <package-name>
The manual page of apt-get (You can also refer to manual page with
man apt-get command) mentions:
-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 or removing an essential package, occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.
Contrary to this parameter, you also have
Automatic "no" to all prompts. Configuration Item: APT::Get::Assume-No.
For Vlastimil's comment, I tried
sudo apt-get install --fix-broken --assume-yes
And it works. The
--fix-broken part of the command can be replaced with
--yes for convenience. This will not install any package in perticular but "can omit any packages to permit APT to deduce a likely solution", as mentioned on the manual page.