What is the difference between yum update and yum upgrade, and when should I use one over the other?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
yum upgrade forces the removal of obsolete packages, while yum update may or may not also do this. The removal of obsolete packages can be risky, as it may remove packages that you use.
This makes yum update the safer option.
From man yum:
update
If run without any packages, update will update every currently installed package. If one or more packages or package globs are specified, Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied. (See Specifying package names for more information) If the packages or globs specified match to packages which are not currently installed then update will not install them. update operates on groups, files, provides and filelists just like the “install” command.
If the main obsoletes configure option is true (default) or the –obsoletes flag is present yum will include package obsoletes in its calculations – this makes it better for distro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9.upgrade
Is the same as the update command with the –obsoletes flag set. See update for more details.
Method 2
yum upgrade and yum update will perform the same function that update to the latest current version of package.
But the difference is Upgrade will delete obsolete packages, while update will preserve them.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0