加入收藏 | 设为首页 | 会员中心 | 我要投稿 百客网 - 百科网 (https://www.baikewang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

linux下yum upgradeyum update有什么区别?

发布时间:2022-06-14 12:34:05 所属栏目:教程 来源:互联网
导读:yum upgrade、yum update在linux中都可以用更新新软件安装包或升级软件了,那么这yum upgrade、yum update有什么区别呢?下面我们就一起来看看吧. 在网上看到有人如下总结: yum -y update 升级所有包,改变软件设置和系统设置,系统版本内核都升级 yum -y upgrad
  yum upgrade、yum update在linux中都可以用更新新软件安装包或升级软件了,那么这yum upgrade、yum update有什么区别呢?下面我们就一起来看看吧.
 
  在网上看到有人如下总结:
 
  yum -y update
 
  升级所有包,改变软件设置和系统设置,系统版本内核都升级
 
  yum -y upgrade
 
  升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变.
 
  测试一下所谓yum upgrade于yum update的区别:
 
  基本信息:
 
  [root@localhost ~]# uname -a    
 
  Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
 
  [root@localhost ~]# cat /etc/redhat-release  
 
  CentOS release 6.4 (Final)
 
  man yum:
 
  --obsoletes:This option only has affect for an update, it enables yum´s obsoletes processing logic. For more information see the update command above.
 
  Configuration Option: obsoletes
 
  upgrade:Is the same as the update command with the --obsoletes flag set. See update for more details.
 
  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" 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:
 
  Installed:
 
    kernel.x86_64 0:2.6.32-504.12.2.el6                                                                                                
 
  Dependency Installed:
 
    libtasn1.x86_64 0:2.3-6.el6_5          p11-kit.x86_64 0:0.18.5-2.el6_5.2           p11-kit-trust.x86_64 0:0.18.5-2.el6_5.2        
 
    pkgconfig.x86_64 1:0.23-9.1.el6        shared-mime-info.x86_64 0:0.70-6.el6       
 
  Updated:
 
    audit.x86_64 0:2.3.7-5.el6                                         audit-libs.x86_64 0:2.3.7-5.el6                                 
 
    authconfig.x86_64 0:6.1.12-19.el6                                  bash.x86_64 0:4.1.2-29.el6                                      
 
    binutils.x86_64 0:2.20.51.0.2-5.42.el6                             ca-certificates.noarch 0:2014.1.98-65.1.el6                     
 
    centos-release.x86_64 0:6-6.el6.centos.12.2                        chkconfig.x86_64 0:1.3.49.3-2.el6_4.1                           
 
    coreutils.x86_64 0:8.4-37.el6                                      coreutils-libs.x86_64 0:8.4-37.el6                              
 
    cpio.x86_64 0:2.10-12.el6_5                                        cronie.x86_64 0:1.4.4-12.el6                                    
 
    cronie-anacron.x86_64 0:1.4.4-12.el6                               cryptsetup-luks.x86_64 0:1.2.0-11.el6                           
 
    cryptsetup-luks-libs.x86_64 0:1.2.0-11.el6                         curl.x86_64 0:7.19.7-40.el6_6.4                                 
 
    cyrus-sasl.x86_64 0:2.1.23-15.el6_6.1                              cyrus-sasl-lib.x86_64 0:2.1.23-15.el6_6.1                       
 
    db4.x86_64 0:4.7.25-18.el6_4                                       db4-utils.x86_64 0:4.7.25-18.el6_4                              
 
    dbus-glib.x86_64 0:0.86-6.el6                                      device-mapper.x86_64 0:1.02.90-2.el6_6.1                        
 
    device-mapper-event.x86_64 0:1.02.90-2.el6_6.1                     device-mapper-event-libs.x86_64 0:1.02.90-2.el6_6.1             
 
    device-mapper-libs.x86_64 0:1.02.90-2.el6_6.1                      device-mapper-multipath.x86_64 0:0.4.9-80.el6_6.3               
 
    device-mapper-multipath-libs.x86_64 0:0.4.9-80.el6_6.3             device-mapper-persistent-data.x86_64 0:0.3.2-1.el6              
 
    dhclient.x86_64 12:4.1.1-43.P1.el6.centos.1                        dhcp-common.x86_64 12:4.1.1-43.P1.el6.centos.1                  
 
    dracut.noarch 0:004-356.el6_6.1                                    dracut-kernel.noarch 0:004-356.el6_6.1                          
 
    e2fsprogs.x86_64 0:1.41.12-21.el6                                  e2fsprogs-libs.x86_64 0:1.41.12-21.el6                          
 
    efibootmgr.x86_64 0:0.5.4-12.el6                                   elfutils-libelf.x86_64 0:0.158-3.2.el6                          
 
    ethtool.x86_64 2:3.5-5.el6                                         file.x86_64 0:5.04-21.el6                                       
 
    file-libs.x86_64 0:5.04-21.el6                                     glib2.x86_64 0:2.28.8-4.el6                                     
 
    gnupg2.x86_64 0:2.0.14-8.el6                                       grep.x86_64 0:2.6.3-6.el6                                       
 
    grub.x86_64 1:0.97-93.el6                                          grubby.x86_64 0:7.0.15-7.el6                                    
 
    gzip.x86_64 0:1.3.12-22.el6                                        hwdata.noarch 0:0.233-11.1.el6                                  
 
    initscripts.x86_64 0:9.03.46-1.el6.centos.1                        iproute.x86_64 0:2.6.32-33.el6_6                                
 
    iptables.x86_64 0:1.4.7-14.el6                                     iptables-ipv6.x86_64 0:1.4.7-14.el6                             
 
    iputils.x86_64 0:20071127-17.el6_4.2                               iscsi-initiator-utils.x86_64 0:6.2.0.873-13.el6                 
 
    kernel-firmware.noarch 0:2.6.32-504.12.2.el6                       keyutils-libs.x86_64 0:1.4-5.el6                                
 
    kpartx.x86_64 0:0.4.9-80.el6_6.3                                   krb5-libs.x86_64 0:1.10.3-33.el6                                
 
    less.x86_64 0:436-13.el6                                           libblkid.x86_64 0:2.17.2-12.18.el6                              
 
    libcom_err.x86_64 0:1.41.12-21.el6                                 libcurl.x86_64 0:7.19.7-40.el6_6.4                              
 
    libdrm.x86_64 0:2.4.52-4.el6                                       libgcrypt.x86_64 0:1.4.5-11.el6_4                               
 
    libpciaccess.x86_64 0:0.13.3-0.1.el6                               libselinux.x86_64 0:2.0.94-5.8.el6                              
 
    libselinux-utils.x86_64 0:2.0.94-5.8.el6                           libss.x86_64 0:1.41.12-21.el6                                   
 
    libssh2.x86_64 0:1.4.2-1.el6_6.1                                   libudev.x86_64 0:147-2.57.el6                                   
 
    libuuid.x86_64 0:2.17.2-12.18.el6                                  libxml2.x86_64 0:2.7.6-17.el6_6.1                               
 
    logrotate.x86_64 0:3.7.8-17.el6                                    lvm2.x86_64 0:2.02.111-2.el6_6.1                                
 
    lvm2-libs.x86_64 0:2.02.111-2.el6_6.1                              mdadm.x86_64 0:3.3-6.el6_6.1                                    
 
    module-init-tools.x86_64 0:3.9-24.el6                              mysql-libs.x86_64 0:5.1.73-3.el6_5                              
 
    nspr.x86_64 0:4.10.6-1.el6_5                                       nss.x86_64 0:3.16.2.3-3.el6_6                                   
 
    nss-softokn.x86_64 0:3.14.3-22.el6_6                               nss-softokn-freebl.x86_64 0:3.14.3-22.el6_6                     
 
    nss-sysinit.x86_64 0:3.16.2.3-3.el6_6                              nss-tools.x86_64 0:3.16.2.3-3.el6_6                             
 
    nss-util.x86_64 0:3.16.2.3-2.el6_6                                 openldap.x86_64 0:2.4.39-8.el6                                  
 
    openssh.x86_64 0:5.3p1-104.el6_6.1                                 openssh-clients.x86_64 0:5.3p1-104.el6_6.1                      
 
    openssh-server.x86_64 0:5.3p1-104.el6_6.1                          pam.x86_64 0:1.1.1-20.el6                                       
 
    pciutils-libs.x86_64 0:3.1.10-4.el6                                plymouth.x86_64 0:0.8.3-27.el6.centos.1                         
 
    plymouth-core-libs.x86_64 0:0.8.3-27.el6.centos.1                  plymouth-scripts.x86_64 0:0.8.3-27.el6.centos.1                 
 
    policycoreutils.x86_64 0:2.0.83-19.47.el6_6.1                      postfix.x86_64 2:2.6.6-6.el6_5                                  
 
    procps.x86_64 0:3.2.8-30.el6                                       psmisc.x86_64 0:22.6-19.el6_5                                   
 
    python.x86_64 0:2.6.6-52.el6                                       python-libs.x86_64 0:2.6.6-52.el6                               
 
    python-urlgrabber.noarch 0:3.9.1-9.el6                             rpm.x86_64 0:4.8.0-38.el6_6                                     
 
    rpm-libs.x86_64 0:4.8.0-38.el6_6                                   rpm-python.x86_64 0:4.8.0-38.el6_6                              
 
    rsyslog.x86_64 0:5.8.10-10.el6_6                                   selinux-policy.noarch 0:3.7.19-260.el6_6.2                      
 
    selinux-policy-targeted.noarch 0:3.7.19-260.el6_6.2                setup.noarch 0:2.8.14-20.el6_4.1                                
 
    shadow-utils.x86_64 2:4.1.4.2-19.el6                               sudo.x86_64 0:1.8.6p3-15.el6                                    
 
    system-config-firewall-base.noarch 0:1.2.27-7.2.el6_6              sysvinit-tools.x86_64 0:2.87-5.dsf.el6                          
 
    tzdata.noarch 0:2015a-1.el6                                        udev.x86_64 0:147-2.57.el6                                      
 
    upstart.x86_64 0:0.6.5-13.el6_5.3                                  util-linux-ng.x86_64 0:2.17.2-12.18.el6                         
 
    xfsprogs.x86_64 0:3.1.1-16.el6                                     xz-libs.x86_64 0:4.999.9-0.5.beta.20091007git.el6               
 
    yum.noarch 0:3.2.29-60.el6.centos                                  yum-plugin-fastestmirror.noarch 0:1.1.30-30.el6                
 
  Complete!
 
  [root@localhost ~]# reboot
 
  [root@localhost ~]# uname -a    
 
  Linux localhost.localdomain 2.6.32-504.12.2.el6.x86_64 #内核升级了!
 
  [root@localhost ~]# cat /etc/redhat-release  
 
  CentOS release 6.6 (Final)

  yum update:
 
  Installed:
 
    kernel.x86_64 0:2.6.32-504.12.2.el6                                                                                                
 
  Dependency Installed:
 
    libtasn1.x86_64 0:2.3-6.el6_5          p11-kit.x86_64 0:0.18.5-2.el6_5.2           p11-kit-trust.x86_64 0:0.18.5-2.el6_5.2        
 
    pkgconfig.x86_64 1:0.23-9.1.el6        shared-mime-info.x86_64 0:0.70-6.el6       
 
  Updated:
 
    audit.x86_64 0:2.3.7-5.el6                                         audit-libs.x86_64 0:2.3.7-5.el6                                 
 
    authconfig.x86_64 0:6.1.12-19.el6                                  bash.x86_64 0:4.1.2-29.el6                                      
 
    binutils.x86_64 0:2.20.51.0.2-5.42.el6                             ca-certificates.noarch 0:2014.1.98-65.1.el6                     
 
    centos-release.x86_64 0:6-6.el6.centos.12.2                        chkconfig.x86_64 0:1.3.49.3-2.el6_4.1                           
 
    coreutils.x86_64 0:8.4-37.el6                                      coreutils-libs.x86_64 0:8.4-37.el6                              
 
    cpio.x86_64 0:2.10-12.el6_5                                        cronie.x86_64 0:1.4.4-12.el6                                    
 
    cronie-anacron.x86_64 0:1.4.4-12.el6                               cryptsetup-luks.x86_64 0:1.2.0-11.el6                           
 
    cryptsetup-luks-libs.x86_64 0:1.2.0-11.el6                         curl.x86_64 0:7.19.7-40.el6_6.4                                 
 
    cyrus-sasl.x86_64 0:2.1.23-15.el6_6.1                              cyrus-sasl-lib.x86_64 0:2.1.23-15.el6_6.1                       
 
    db4.x86_64 0:4.7.25-18.el6_4                                       db4-utils.x86_64 0:4.7.25-18.el6_4                              
 
    dbus-glib.x86_64 0:0.86-6.el6                                      device-mapper.x86_64 0:1.02.90-2.el6_6.1                        
 
    device-mapper-event.x86_64 0:1.02.90-2.el6_6.1                     device-mapper-event-libs.x86_64 0:1.02.90-2.el6_6.1             
 
    device-mapper-libs.x86_64 0:1.02.90-2.el6_6.1                      device-mapper-multipath.x86_64 0:0.4.9-80.el6_6.3               
 
    device-mapper-multipath-libs.x86_64 0:0.4.9-80.el6_6.3             device-mapper-persistent-data.x86_64 0:0.3.2-1.el6              
 
    dhclient.x86_64 12:4.1.1-43.P1.el6.centos.1                        dhcp-common.x86_64 12:4.1.1-43.P1.el6.centos.1                  
 
    dracut.noarch 0:004-356.el6_6.1                                    dracut-kernel.noarch 0:004-356.el6_6.1                          
 
    e2fsprogs.x86_64 0:1.41.12-21.el6                                  e2fsprogs-libs.x86_64 0:1.41.12-21.el6                          
 
    efibootmgr.x86_64 0:0.5.4-12.el6                                   elfutils-libelf.x86_64 0:0.158-3.2.el6                          
 
    ethtool.x86_64 2:3.5-5.el6                                         file.x86_64 0:5.04-21.el6                                       
 
    file-libs.x86_64 0:5.04-21.el6                                     glib2.x86_64 0:2.28.8-4.el6                                     
 
    gnupg2.x86_64 0:2.0.14-8.el6                                       grep.x86_64 0:2.6.3-6.el6                                       
 
    grub.x86_64 1:0.97-93.el6                                          grubby.x86_64 0:7.0.15-7.el6                                    
 
    gzip.x86_64 0:1.3.12-22.el6                                        hwdata.noarch 0:0.233-11.1.el6                                  
 
    initscripts.x86_64 0:9.03.46-1.el6.centos.1                        iproute.x86_64 0:2.6.32-33.el6_6                                
 
    iptables.x86_64 0:1.4.7-14.el6                                     iptables-ipv6.x86_64 0:1.4.7-14.el6                             
 
    iputils.x86_64 0:20071127-17.el6_4.2                               iscsi-initiator-utils.x86_64 0:6.2.0.873-13.el6                 
 
    kernel-firmware.noarch 0:2.6.32-504.12.2.el6                       keyutils-libs.x86_64 0:1.4-5.el6                                
 
    kpartx.x86_64 0:0.4.9-80.el6_6.3                                   krb5-libs.x86_64 0:1.10.3-33.el6                                
 
    less.x86_64 0:436-13.el6                                           libblkid.x86_64 0:2.17.2-12.18.el6                              
 
    libcom_err.x86_64 0:1.41.12-21.el6                                 libcurl.x86_64 0:7.19.7-40.el6_6.4                              
 
    libdrm.x86_64 0:2.4.52-4.el6                                       libgcrypt.x86_64 0:1.4.5-11.el6_4                               
 
    libpciaccess.x86_64 0:0.13.3-0.1.el6                               libselinux.x86_64 0:2.0.94-5.8.el6                              
 
    libselinux-utils.x86_64 0:2.0.94-5.8.el6                           libss.x86_64 0:1.41.12-21.el6                                   
 
    libssh2.x86_64 0:1.4.2-1.el6_6.1                                   libudev.x86_64 0:147-2.57.el6                                   
 
    libuuid.x86_64 0:2.17.2-12.18.el6                                  libxml2.x86_64 0:2.7.6-17.el6_6.1                               
 
    logrotate.x86_64 0:3.7.8-17.el6                                    lvm2.x86_64 0:2.02.111-2.el6_6.1                                
 
    lvm2-libs.x86_64 0:2.02.111-2.el6_6.1                              mdadm.x86_64 0:3.3-6.el6_6.1                                    
 
    module-init-tools.x86_64 0:3.9-24.el6                              mysql-libs.x86_64 0:5.1.73-3.el6_5                              
 
    nspr.x86_64 0:4.10.6-1.el6_5                                       nss.x86_64 0:3.16.2.3-3.el6_6                                   
 
    nss-softokn.x86_64 0:3.14.3-22.el6_6                               nss-softokn-freebl.x86_64 0:3.14.3-22.el6_6                     
 
    nss-sysinit.x86_64 0:3.16.2.3-3.el6_6                              nss-tools.x86_64 0:3.16.2.3-3.el6_6                             
 
    nss-util.x86_64 0:3.16.2.3-2.el6_6                                 openldap.x86_64 0:2.4.39-8.el6                                  
 
    openssh.x86_64 0:5.3p1-104.el6_6.1                                 openssh-clients.x86_64 0:5.3p1-104.el6_6.1                      
 
    openssh-server.x86_64 0:5.3p1-104.el6_6.1                          pam.x86_64 0:1.1.1-20.el6                                       
 
    pciutils-libs.x86_64 0:3.1.10-4.el6                                plymouth.x86_64 0:0.8.3-27.el6.centos.1                         
 
    plymouth-core-libs.x86_64 0:0.8.3-27.el6.centos.1                  plymouth-scripts.x86_64 0:0.8.3-27.el6.centos.1                 
 
    policycoreutils.x86_64 0:2.0.83-19.47.el6_6.1                      postfix.x86_64 2:2.6.6-6.el6_5                                  
 
    procps.x86_64 0:3.2.8-30.el6                                       psmisc.x86_64 0:22.6-19.el6_5                                   
 
    python.x86_64 0:2.6.6-52.el6                                       python-libs.x86_64 0:2.6.6-52.el6                               
 
    python-urlgrabber.noarch 0:3.9.1-9.el6                             rpm.x86_64 0:4.8.0-38.el6_6                                     
 
    rpm-libs.x86_64 0:4.8.0-38.el6_6                                   rpm-python.x86_64 0:4.8.0-38.el6_6                              
 
    rsyslog.x86_64 0:5.8.10-10.el6_6                                   selinux-policy.noarch 0:3.7.19-260.el6_6.2                      
 
    selinux-policy-targeted.noarch 0:3.7.19-260.el6_6.2                setup.noarch 0:2.8.14-20.el6_4.1                                
 
    shadow-utils.x86_64 2:4.1.4.2-19.el6                               sudo.x86_64 0:1.8.6p3-15.el6                                    
 
    system-config-firewall-base.noarch 0:1.2.27-7.2.el6_6              sysvinit-tools.x86_64 0:2.87-5.dsf.el6                          
 
    tzdata.noarch 0:2015a-1.el6                                        udev.x86_64 0:147-2.57.el6   --phpfensi.com                                   
 
    upstart.x86_64 0:0.6.5-13.el6_5.3                                  util-linux-ng.x86_64 0:2.17.2-12.18.el6                         
 
    xfsprogs.x86_64 0:3.1.1-16.el6                                     xz-libs.x86_64 0:4.999.9-0.5.beta.20091007git.el6               
 
    yum.noarch 0:3.2.29-60.el6.centos                                  yum-plugin-fastestmirror.noarch 0:1.1.30-30.el6                
 
  Complete!
 
  [root@localhost ~]# uname -a
 
  Linux localhost.localdomain 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
 
  [root@localhost ~]# cat /etc/redhat-release  
 
  CentOS release 6.6 (Final)
 
  结论:Centos6.4 升级到 Centos6.6 貌似 yum update 和 yum upgrade 均可.
 

(编辑:百客网 - 百科网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!