Is “yum -y install” safe

yum

Can I use yum -y to automatically install a package without fear that something unrelated will happen? E.g. I wonder if on a broken system some other package may be removed or updated due to dependencies or a precedently interrupted YUM transaction.

I am looking in YUM for what in Debian terms is the difference between apt-get --yes and apt-get --trivial-only.

Best Answer

yum will never decide to remove packages just to install others (Ie. due to conflicts/etc.) it will just fail instead. Are you really worried about upgrades/obsoletes? Or just expecting it to do try random magic stuff like apt/dnf?

You should read the yum.conf man page to see what this does, but while yum doesn't have a direct equivalent of --trivial-only this is pretty close to what you want:

yum --setopt=alwaysprompt=no install foo

...in that it will act like it said yes to just the transaction prompt, if the transaction only contains the name of the package you passed on the command line.

If new package keys need to be installed though, that won't happen (not sure if you'd count that as trivial or not).

Related Question