当前位置:首页 > linux教程 > 列表

linux下yum upgrade、yum update有什么区别?

发布:smiling 来源: PHP粉丝网  添加日期:2015-05-06 15:53:50 浏览: 评论:0 

yum upgrade、yum update在linux中都可以用更新新软件安装包或升级软件了,那么这yum upgrade、yum update有什么区别呢?下面我们就一起来看看吧.

在网上看到有人如下总结:

yum -y update

升级所有包,改变软件设置和系统设置,系统版本内核都升级

yum -y upgrade

升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变.

测试一下所谓yum upgrade于yum update的区别:

基本信息:

  1. [root@localhost ~]# uname -a    
  2. 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 
  3. [root@localhost ~]# cat /etc/redhat-release  
  4. CentOS release 6.4 (Final) 
  5. man yum: 
  6. --obsoletes:This option only has affect for an update, it enables yum´s obsoletes processing logic. For more information see the update command above. 
  7. Configuration Option: obsoletes 
  8. upgrade:Is the same as the update command with the --obsoletes flag set. See update for more details. 
  9. 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) 
  10. 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. 
  11. 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. 
  12. 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. 
  13. yum upgrade: 
  14. Installed: 
  15.   kernel.x86_64 0:2.6.32-504.12.2.el6                                                                                                
  16. Dependency Installed: 
  17.   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        
  18.   pkgconfig.x86_64 1:0.23-9.1.el6        shared-mime-info.x86_64 0:0.70-6.el6       
  19. Updated: 
  20.   audit.x86_64 0:2.3.7-5.el6                                         audit-libs.x86_64 0:2.3.7-5.el6                                 
  21.   authconfig.x86_64 0:6.1.12-19.el6                                  bash.x86_64 0:4.1.2-29.el6                                      
  22.   binutils.x86_64 0:2.20.51.0.2-5.42.el6                             ca-certificates.noarch 0:2014.1.98-65.1.el6                     
  23.   centos-release.x86_64 0:6-6.el6.centos.12.2                        chkconfig.x86_64 0:1.3.49.3-2.el6_4.1                           
  24.   coreutils.x86_64 0:8.4-37.el6                                      coreutils-libs.x86_64 0:8.4-37.el6                              
  25.   cpio.x86_64 0:2.10-12.el6_5                                        cronie.x86_64 0:1.4.4-12.el6                                    
  26.   cronie-anacron.x86_64 0:1.4.4-12.el6                               cryptsetup-luks.x86_64 0:1.2.0-11.el6                           
  27.   cryptsetup-luks-libs.x86_64 0:1.2.0-11.el6                         curl.x86_64 0:7.19.7-40.el6_6.4                                 
  28.   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                       
  29.   db4.x86_64 0:4.7.25-18.el6_4                                       db4-utils.x86_64 0:4.7.25-18.el6_4                              
  30.   dbus-glib.x86_64 0:0.86-6.el6                                      device-mapper.x86_64 0:1.02.90-2.el6_6.1                        
  31.   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             
  32.   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               
  33.   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              
  34.   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                  
  35.   dracut.noarch 0:004-356.el6_6.1                                    dracut-kernel.noarch 0:004-356.el6_6.1                          
  36.   e2fsprogs.x86_64 0:1.41.12-21.el6                                  e2fsprogs-libs.x86_64 0:1.41.12-21.el6                          
  37.   efibootmgr.x86_64 0:0.5.4-12.el6                                   elfutils-libelf.x86_64 0:0.158-3.2.el6                          
  38.   ethtool.x86_64 2:3.5-5.el6                                         file.x86_64 0:5.04-21.el6                                       
  39.   file-libs.x86_64 0:5.04-21.el6                                     glib2.x86_64 0:2.28.8-4.el6                                     
  40.   gnupg2.x86_64 0:2.0.14-8.el6                                       grep.x86_64 0:2.6.3-6.el6                                       
  41.   grub.x86_64 1:0.97-93.el6                                          grubby.x86_64 0:7.0.15-7.el6                                    
  42.   gzip.x86_64 0:1.3.12-22.el6                                        hwdata.noarch 0:0.233-11.1.el6                                  
  43.   initscripts.x86_64 0:9.03.46-1.el6.centos.1                        iproute.x86_64 0:2.6.32-33.el6_6                                
  44.   iptables.x86_64 0:1.4.7-14.el6                                     iptables-ipv6.x86_64 0:1.4.7-14.el6                             
  45.   iputils.x86_64 0:20071127-17.el6_4.2                               iscsi-initiator-utils.x86_64 0:6.2.0.873-13.el6                 
  46.   kernel-firmware.noarch 0:2.6.32-504.12.2.el6                       keyutils-libs.x86_64 0:1.4-5.el6                                
  47.   kpartx.x86_64 0:0.4.9-80.el6_6.3                                   krb5-libs.x86_64 0:1.10.3-33.el6                                
  48.   less.x86_64 0:436-13.el6                                           libblkid.x86_64 0:2.17.2-12.18.el6                              
  49.   libcom_err.x86_64 0:1.41.12-21.el6                                 libcurl.x86_64 0:7.19.7-40.el6_6.4                              
  50.   libdrm.x86_64 0:2.4.52-4.el6                                       libgcrypt.x86_64 0:1.4.5-11.el6_4                               
  51.   libpciaccess.x86_64 0:0.13.3-0.1.el6                               libselinux.x86_64 0:2.0.94-5.8.el6                              
  52.   libselinux-utils.x86_64 0:2.0.94-5.8.el6                           libss.x86_64 0:1.41.12-21.el6                                   
  53.   libssh2.x86_64 0:1.4.2-1.el6_6.1                                   libudev.x86_64 0:147-2.57.el6                                   
  54.   libuuid.x86_64 0:2.17.2-12.18.el6                                  libxml2.x86_64 0:2.7.6-17.el6_6.1                               
  55.   logrotate.x86_64 0:3.7.8-17.el6                                    lvm2.x86_64 0:2.02.111-2.el6_6.1                                
  56.   lvm2-libs.x86_64 0:2.02.111-2.el6_6.1                              mdadm.x86_64 0:3.3-6.el6_6.1                                    
  57.   module-init-tools.x86_64 0:3.9-24.el6                              mysql-libs.x86_64 0:5.1.73-3.el6_5                              
  58.   nspr.x86_64 0:4.10.6-1.el6_5                                       nss.x86_64 0:3.16.2.3-3.el6_6                                   
  59.   nss-softokn.x86_64 0:3.14.3-22.el6_6                               nss-softokn-freebl.x86_64 0:3.14.3-22.el6_6                     
  60.   nss-sysinit.x86_64 0:3.16.2.3-3.el6_6                              nss-tools.x86_64 0:3.16.2.3-3.el6_6                             
  61.   nss-util.x86_64 0:3.16.2.3-2.el6_6                                 openldap.x86_64 0:2.4.39-8.el6                                  
  62.   openssh.x86_64 0:5.3p1-104.el6_6.1                                 openssh-clients.x86_64 0:5.3p1-104.el6_6.1                      
  63.   openssh-server.x86_64 0:5.3p1-104.el6_6.1                          pam.x86_64 0:1.1.1-20.el6                                       
  64.   pciutils-libs.x86_64 0:3.1.10-4.el6                                plymouth.x86_64 0:0.8.3-27.el6.centos.1                         
  65.   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                 
  66.   policycoreutils.x86_64 0:2.0.83-19.47.el6_6.1                      postfix.x86_64 2:2.6.6-6.el6_5                                  
  67.   procps.x86_64 0:3.2.8-30.el6                                       psmisc.x86_64 0:22.6-19.el6_5                                   
  68.   python.x86_64 0:2.6.6-52.el6                                       python-libs.x86_64 0:2.6.6-52.el6                               
  69.   python-urlgrabber.noarch 0:3.9.1-9.el6                             rpm.x86_64 0:4.8.0-38.el6_6                                     
  70.   rpm-libs.x86_64 0:4.8.0-38.el6_6                                   rpm-python.x86_64 0:4.8.0-38.el6_6                              
  71.   rsyslog.x86_64 0:5.8.10-10.el6_6                                   selinux-policy.noarch 0:3.7.19-260.el6_6.2                      
  72.   selinux-policy-targeted.noarch 0:3.7.19-260.el6_6.2                setup.noarch 0:2.8.14-20.el6_4.1                                
  73.   shadow-utils.x86_64 2:4.1.4.2-19.el6                               sudo.x86_64 0:1.8.6p3-15.el6                                    
  74.   system-config-firewall-base.noarch 0:1.2.27-7.2.el6_6              sysvinit-tools.x86_64 0:2.87-5.dsf.el6                          
  75.   tzdata.noarch 0:2015a-1.el6                                        udev.x86_64 0:147-2.57.el6                                      
  76.   upstart.x86_64 0:0.6.5-13.el6_5.3                                  util-linux-ng.x86_64 0:2.17.2-12.18.el6                         
  77.   xfsprogs.x86_64 0:3.1.1-16.el6                                     xz-libs.x86_64 0:4.999.9-0.5.beta.20091007git.el6               
  78.   yum.noarch 0:3.2.29-60.el6.centos                                  yum-plugin-fastestmirror.noarch 0:1.1.30-30.el6                
  79. Complete! 
  80. [root@localhost ~]# reboot 
  81. [root@localhost ~]# uname -a    
  82. Linux localhost.localdomain 2.6.32-504.12.2.el6.x86_64 #内核升级了! 
  83. [root@localhost ~]# cat /etc/redhat-release  
  84. CentOS release 6.6 (Final) 
  85.  
  86. yum update: 
  87. Installed: 
  88.   kernel.x86_64 0:2.6.32-504.12.2.el6                                                                                                
  89. Dependency Installed: 
  90.   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        
  91.   pkgconfig.x86_64 1:0.23-9.1.el6        shared-mime-info.x86_64 0:0.70-6.el6       
  92. Updated: 
  93.   audit.x86_64 0:2.3.7-5.el6                                         audit-libs.x86_64 0:2.3.7-5.el6                                 
  94.   authconfig.x86_64 0:6.1.12-19.el6                                  bash.x86_64 0:4.1.2-29.el6                                      
  95.   binutils.x86_64 0:2.20.51.0.2-5.42.el6                             ca-certificates.noarch 0:2014.1.98-65.1.el6                     
  96.   centos-release.x86_64 0:6-6.el6.centos.12.2                        chkconfig.x86_64 0:1.3.49.3-2.el6_4.1                           
  97.   coreutils.x86_64 0:8.4-37.el6                                      coreutils-libs.x86_64 0:8.4-37.el6                              
  98.   cpio.x86_64 0:2.10-12.el6_5                                        cronie.x86_64 0:1.4.4-12.el6                                    
  99.   cronie-anacron.x86_64 0:1.4.4-12.el6                               cryptsetup-luks.x86_64 0:1.2.0-11.el6                           
  100.   cryptsetup-luks-libs.x86_64 0:1.2.0-11.el6                         curl.x86_64 0:7.19.7-40.el6_6.4                                 
  101.   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                       
  102.   db4.x86_64 0:4.7.25-18.el6_4                                       db4-utils.x86_64 0:4.7.25-18.el6_4                              
  103.   dbus-glib.x86_64 0:0.86-6.el6                                      device-mapper.x86_64 0:1.02.90-2.el6_6.1                        
  104.   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             
  105.   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               
  106.   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              
  107.   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                  
  108.   dracut.noarch 0:004-356.el6_6.1                                    dracut-kernel.noarch 0:004-356.el6_6.1                          
  109.   e2fsprogs.x86_64 0:1.41.12-21.el6                                  e2fsprogs-libs.x86_64 0:1.41.12-21.el6                          
  110.   efibootmgr.x86_64 0:0.5.4-12.el6                                   elfutils-libelf.x86_64 0:0.158-3.2.el6                          
  111.   ethtool.x86_64 2:3.5-5.el6                                         file.x86_64 0:5.04-21.el6                                       
  112.   file-libs.x86_64 0:5.04-21.el6                                     glib2.x86_64 0:2.28.8-4.el6                                     
  113.   gnupg2.x86_64 0:2.0.14-8.el6                                       grep.x86_64 0:2.6.3-6.el6                                       
  114.   grub.x86_64 1:0.97-93.el6                                          grubby.x86_64 0:7.0.15-7.el6                                    
  115.   gzip.x86_64 0:1.3.12-22.el6                                        hwdata.noarch 0:0.233-11.1.el6                                  
  116.   initscripts.x86_64 0:9.03.46-1.el6.centos.1                        iproute.x86_64 0:2.6.32-33.el6_6                                
  117.   iptables.x86_64 0:1.4.7-14.el6                                     iptables-ipv6.x86_64 0:1.4.7-14.el6                             
  118.   iputils.x86_64 0:20071127-17.el6_4.2                               iscsi-initiator-utils.x86_64 0:6.2.0.873-13.el6                 
  119.   kernel-firmware.noarch 0:2.6.32-504.12.2.el6                       keyutils-libs.x86_64 0:1.4-5.el6                                
  120.   kpartx.x86_64 0:0.4.9-80.el6_6.3                                   krb5-libs.x86_64 0:1.10.3-33.el6                                
  121.   less.x86_64 0:436-13.el6                                           libblkid.x86_64 0:2.17.2-12.18.el6                              
  122.   libcom_err.x86_64 0:1.41.12-21.el6                                 libcurl.x86_64 0:7.19.7-40.el6_6.4                              
  123.   libdrm.x86_64 0:2.4.52-4.el6                                       libgcrypt.x86_64 0:1.4.5-11.el6_4                               
  124.   libpciaccess.x86_64 0:0.13.3-0.1.el6                               libselinux.x86_64 0:2.0.94-5.8.el6                              
  125.   libselinux-utils.x86_64 0:2.0.94-5.8.el6                           libss.x86_64 0:1.41.12-21.el6                                   
  126.   libssh2.x86_64 0:1.4.2-1.el6_6.1                                   libudev.x86_64 0:147-2.57.el6                                   
  127.   libuuid.x86_64 0:2.17.2-12.18.el6                                  libxml2.x86_64 0:2.7.6-17.el6_6.1                               
  128.   logrotate.x86_64 0:3.7.8-17.el6                                    lvm2.x86_64 0:2.02.111-2.el6_6.1                                
  129.   lvm2-libs.x86_64 0:2.02.111-2.el6_6.1                              mdadm.x86_64 0:3.3-6.el6_6.1                                    
  130.   module-init-tools.x86_64 0:3.9-24.el6                              mysql-libs.x86_64 0:5.1.73-3.el6_5                              
  131.   nspr.x86_64 0:4.10.6-1.el6_5                                       nss.x86_64 0:3.16.2.3-3.el6_6                                   
  132.   nss-softokn.x86_64 0:3.14.3-22.el6_6                               nss-softokn-freebl.x86_64 0:3.14.3-22.el6_6                     
  133.   nss-sysinit.x86_64 0:3.16.2.3-3.el6_6                              nss-tools.x86_64 0:3.16.2.3-3.el6_6                             
  134.   nss-util.x86_64 0:3.16.2.3-2.el6_6                                 openldap.x86_64 0:2.4.39-8.el6                                  
  135.   openssh.x86_64 0:5.3p1-104.el6_6.1                                 openssh-clients.x86_64 0:5.3p1-104.el6_6.1                      
  136.   openssh-server.x86_64 0:5.3p1-104.el6_6.1                          pam.x86_64 0:1.1.1-20.el6                                       
  137.   pciutils-libs.x86_64 0:3.1.10-4.el6                                plymouth.x86_64 0:0.8.3-27.el6.centos.1                         
  138.   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                 
  139.   policycoreutils.x86_64 0:2.0.83-19.47.el6_6.1                      postfix.x86_64 2:2.6.6-6.el6_5                                  
  140.   procps.x86_64 0:3.2.8-30.el6                                       psmisc.x86_64 0:22.6-19.el6_5                                   
  141.   python.x86_64 0:2.6.6-52.el6                                       python-libs.x86_64 0:2.6.6-52.el6                               
  142.   python-urlgrabber.noarch 0:3.9.1-9.el6                             rpm.x86_64 0:4.8.0-38.el6_6                                     
  143.   rpm-libs.x86_64 0:4.8.0-38.el6_6                                   rpm-python.x86_64 0:4.8.0-38.el6_6                              
  144.   rsyslog.x86_64 0:5.8.10-10.el6_6                                   selinux-policy.noarch 0:3.7.19-260.el6_6.2                      
  145.   selinux-policy-targeted.noarch 0:3.7.19-260.el6_6.2                setup.noarch 0:2.8.14-20.el6_4.1                                
  146.   shadow-utils.x86_64 2:4.1.4.2-19.el6                               sudo.x86_64 0:1.8.6p3-15.el6                                    
  147.   system-config-firewall-base.noarch 0:1.2.27-7.2.el6_6              sysvinit-tools.x86_64 0:2.87-5.dsf.el6                          
  148.   tzdata.noarch 0:2015a-1.el6                                        udev.x86_64 0:147-2.57.el6   --phpfensi.com                                   
  149.   upstart.x86_64 0:0.6.5-13.el6_5.3                                  util-linux-ng.x86_64 0:2.17.2-12.18.el6                         
  150.   xfsprogs.x86_64 0:3.1.1-16.el6                                     xz-libs.x86_64 0:4.999.9-0.5.beta.20091007git.el6               
  151.   yum.noarch 0:3.2.29-60.el6.centos                                  yum-plugin-fastestmirror.noarch 0:1.1.30-30.el6                
  152. Complete! 
  153. [root@localhost ~]# uname -a 
  154. 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 
  155. [root@localhost ~]# cat /etc/redhat-release  
  156. CentOS release 6.6 (Final) 

结论:Centos6.4 升级到 Centos6.6 貌似 yum update 和 yum upgrade 均可.

Tags: yum upgrade update

分享到: