yum update和yum upgrade区别

可以通过man yum查看yum update和yum upgrade区别


 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.


Is the same as the update command with the --obsoletes flag set. See update for more details.

大致意思就是,yum upgrade 等于 yum update --obsoletes, 默认情况下obsoletes 为true在 ,/etc/yum.conf 文件中可以查看到默认的配置信息,也就是说默认情况下没有区别。yum update 更加灵活、安全。

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.