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 ?