Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
wow. My man-fu has failed me :|. Thank Diogo :) –  warren Jun 6 '12 at 14:16
    
I 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 Jun 6 '12 at 15:19
    
More detail on ServerFault here: serverfault.com/a/298158/88886 –  degenerate Jul 2 at 21:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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