系统环境:CentOS Linux release 7.7.1908 (Core)
网上看到,很多说关于yum update和yum upgrade的区别是,
update会升级所有包同时也升级软件和系统内核,而upgrade只升级所有包,不升级软件和系统内核
其实这种说法是错误的!!!!!!!
首页通过man yum命令看update解释如下:
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" com‐ mand. 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. Note that "update" works on installed packages first, and only if there are no matches does it look for available packages. The difference is most noticeable when you do "update foo-1-2" which will act exactly as "update foo" if foo-1-2 is installed. You can use the "update-to" if you'd prefer that nothing happen in the above case.
再看upgrade的解释:
upgrade Is the same as the update command with the --obsoletes flag set. See update for more details.
这里可以看出,yum upgrade 其实就是和yum update --obsoletes的效果是一样的,默认情况下/etc/yum.conf中就注明了obsoletes=1
总结:默认情况,都会升级内核、系统版本及every currently installed package,笔者测试甚至连安装的httpd软件包都是给升级了的!
那么自然也会清除旧的软件版本,不过yum根据自己的计算或者推测决定是否obsoletes旧版本的,像内核之类的就会同时保留旧的版本!
不过最后笔者再次测试,将/etc/yum.conf中obsoletes的值改为0,yum update后,也暂时没有发现什么不同,希望各位大佬能评论说出区别。
尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/13040260.html
作者:一名卑微的IT民工
出处:https://www.cnblogs.com/5201351
本博客所有文章仅用于学习、研究和交流目的,欢迎非商业性质转载。
由于博主的水平不高,文章没有高度、深度和广度,只是凑字数,不足和错误之处在所难免,希望大家能够批评指出。
博主是利用读书、参考、引用、复制和粘贴等多种方式打造成自己的文章,请原谅博主成为一个卑微的IT民工!