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.

  • --trivial-only: Only perform operations that are 'trivial'. Logically this can be considered related to --assume-yes; where --assume-yes will answer yes to any prompt, --trivial-only will answer no. – Braiam Jun 3 '15 at 22:23
  • I clarified that I am looking for the YUM equivalent of --trivial-only. – Marco d'Itri Jun 3 '15 at 22:26
  • Your title doesn't say that. Make sure your title and opening says exactly what you want to know. The questions are "Is “yum -y install” safe?" and "Can I use yum -y to automatically install a package without fear that something unrelated will happen?" You don't tell anything about what would be the --trivial-only equivalent. – Braiam Jun 3 '15 at 22:27

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).

| improve this answer | |

A good rule of thumb is:

I would recommend you to do that with pretty well-known packages only i.e. Apache, ssh, mysql because obviously there's a big chance that if something which is not good happens during installation somebody else would have already spotted it(which has happen very rarely with those kind of packages). But if you install something like i.e. squid or similar although I doubt something like this would happen but you never know.

The packages though that you downloaded from the internet you really want to keep a close eye of what they are doing to your system although is not recommended to install those kind of packages if you don't really need to do it.

| improve this answer | |

The -y will accept any and every prompt in the y/n way. That means, that if without it it will ask you if you want to realize some operation, it will instead auto-accept it. So, it's as safe as when you install software and respond yes to any prompt, which is dependent of the operation you will be realizing.

| improve this answer | |

The -y option answers yes to every interruption that may arrive in y/n format. Regarding to whether it's safe: Packages depend on some other packages. Usually that's the only area I've encountered y/n interruptions. So -y option accepts to install all required packages without prompting you.

So for common packages it's safe. However caution is required when dealing with packages from repositories other than the standard ones.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.