签到成功

知道了

CNDBA社区CNDBA社区

yum update 和 yum upgrade区别

2022-01-01 15:33 1110 0 原创 Linux
作者: hbhe0316

网上的说法:
yum -y update
升级所有包同时也升级软件、系统版本和系统内核
yum -y upgrade
只升级所有包和系统版本,不升级软件和系统内核http://www.cndba.cn/hbhe0316/article/103899

http://www.cndba.cn/hbhe0316/article/103899
http://www.cndba.cn/hbhe0316/article/103899

实际测试结果:
使用了Centos 7.9测试
分别执行命令yum update -y 和yum upgrade -y后
内核从http://www.cndba.cn/hbhe0316/article/103899

[root@ansible ~]# uname -r
3.10.0-1160.45.1.el7.x86_64

变成http://www.cndba.cn/hbhe0316/article/103899

[root@ansible ~]# uname -r
3.10.0-1160.49.1.el7.x86_64

说明内核都升级了,而且是升级到相同版本。

http://www.cndba.cn/hbhe0316/article/103899
http://www.cndba.cn/hbhe0316/article/103899http://www.cndba.cn/hbhe0316/article/103899http://www.cndba.cn/hbhe0316/article/103899

3.官网说法:http://www.cndba.cn/hbhe0316/article/103899

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 speci-
fied 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.

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.
yum upgrade:
Is the same as the update command with the --obsoletes flag set. See update for more details.

版权声明:本文为博主原创文章,未经博主允许不得转载。

LINUX

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1147885次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ