15

On Ubuntu you can use something like this:

export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update

Which will prevent things that require input (choosing grub versions or conflicts between configuration files, or even prompting for a mysql root password during install)

I checked the man page for yum but didn't see anything related to non-interactive usage other than check-update which "Returns exit value of 100 if there are packages available for an update"

Does Yum have an equivalent to apt / aptitude's DEBIAN_FRONTEND=noninteractive ?

cwd
  • 44,479
  • 71
  • 146
  • 167
  • `yum/rpm` doesn't have an equivalent to `debconf`. It doesn't do things like prompt for a `mysql` password. – jordanm Aug 22 '13 at 22:00

2 Answers2

18

By long-standing convention, RPMs themselves never ask for any interactive input. Batch mode is assumed. Some terrible vendor RPMs may attempt anyway, but since they're not supposed to do that, there's never been much call to have an external feature to work around the bad behavior — just avoid or fix those RPMs.

Sometimes yum itself asks for confirmation. For this, you can give -y to tell yum to assume "yes".

mattdm
  • 39,535
  • 18
  • 99
  • 133
6

yum has the -y option. Adding this tells yum to assume "yes" as the answer to any question asked.

JRFerguson
  • 14,570
  • 3
  • 34
  • 40