yum 命令 update 与 upgrade 的区别


man yum ,以及测试(centos 6.4版本)后,我认为,update 与 upgrade 并没有实质性的区别。网上说:

yum -y update
升级所有包,改变软件设置和系统设置,系统版本内核都升级
yum -y upgrade
升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变

这是错误的! 


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

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


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
引用: Linux yum中package升级命令有两个分别是 yum upgradeyum update。 引用: yumupgrade 是等价于打开 obsoletes 配置的 yum update。 而默认中/etc/yum.conf配置文件obsoletes是打开的,因此这两个指令针对系统内核来说是等价的。 引用: 若一定要升级,如果软件依赖旧版本的package,最好是使用 yum update,确保不会出现兼容问题。 但再正式环境最好不要使用yum更新,会出现意想不到的问题。 yum update是Linux下的一个命令,用于更新系统中的软件包。与yum upgrade相比,yum update命令会更加激进地更新软件包,包括升级到新的主要版本。在默认配置下,yum update命令会打开obsoletes选项,这意味着它会自动移除旧版本的软件包并安装新版本。 然而,在升级软件包时,存在一些潜在的风险。如果系统中的其他软件依赖于旧版本的软件包,使用yum update命令可能会导致兼容性问题。因此,在一些正式环境中,最好避免使用yum update命令,以免出现意外情况。相反,可以使用yum upgrade命令来进行软件包升级,这将更加谨慎地处理依赖关系,并确保不会破坏系统的稳定性。 综上所述,yum update命令是用于更新系统中的软件包,但在使用时需要注意可能的兼容性问题。在正式环境中,建议使用yum upgrade命令进行软件包的升级。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值