What is the technical differences between "update" and "upgrade" with yum?

6

1

I frequently use the following when updating/upgrading RPM-based distros (CentOS, RHEL, and Fedora in my case):

yum -y update && yum -y upgrade

However, I'm not sure exactly how the two yum commands differ.

What are the advantages of update over upgrade, and vice versa?

warren

Posted 2012-06-06T13:33:55.290

Reputation: 8 599

Answers

8

According to 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. […]

If […] 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.

Diogo

Posted 2012-06-06T13:33:55.290

Reputation: 28 202

More detail on ServerFault here: http://serverfault.com/a/298158/88886

– degenerate – 2014-07-02T21:26:05.827

wow. My man-fu has failed me :|. Thank Diogo :) – warren – 2012-06-06T14:16:56.720

1I imagine/hope OP already read the man page. What it results in is that upgrade will delete obsolete packages In practice, you generally use update or update <package name> for day to day stuff, and reserve upgrade for occasions where you are doing full system upgrade to a new distribution version. – UpAndAdam – 2012-06-06T15:19:28.933