linux下yum upgrade、yum update有什么区别?
2019/10/10/17:44:56 阅读:1890 来源:谷歌SEO算法 标签:
百度细雨算法
yum upgrade、yum update在linux中都可以用更新新软件安装包或升级软件了,那么这yum upgrade、yum update有什么区别呢?下面我们就一起来看看吧.
在网上看到有人如下总结:
yum -y update
升级所有包,改变软件设置和系统设置,系统版本内核都升级
yum -y upgrade
升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变.
测试一下所谓yum upgrade于yum update的区别:
基本信息:
- [root@localhost~]#uname-a
- Linuxlocalhost.localdomain2.6.32-358.el6.x86_64#1SMPFriFeb2200:31:26UTC2013x86_64x86_64x86_64GNU/Linux
- [root@localhost~]#cat/etc/redhat-release
- CentOSrelease6.4(Final)
- manyum:
- --obsoletes:Thisoptiononlyhasaffectforanupdate,itenablesyum´sobsoletesprocessinglogic.Formoreinformationseetheupdatecommandabove.
- ConfigurationOption:obsoletes
- upgrade:Isthesameastheupdatecommandwiththe--obsoletesflagset.Seeupdateformoredetails.
- update:Ifrunwithoutanypackages,updatewillupdateeverycurrentlyinstalledpackage.Ifoneormorepackagesorpackageglobsarespecified,Yumwillonlyupdatethelistedpackages.Whileupdatingpackages,yumwillensurethatalldependenciesaresatisfied.(SeeSpecifyingpackagenamesformoreinformation)
- Ifthepackagesorglobsspecifiedmatchtopackageswhicharenotcurrentlyinstalledthenupdatewillnotinstallthem.updateoperatesongroups,files,providesandfilelistsjustlikethe"install"command.
- Ifthemainobsoletesconfigureoptionistrue(default)orthe--obsoletesflagispresentyumwillincludepackageobsoletesinitscalculations-thismakesitbetterfordistro-versionchanges,forexample:upgradingfromsomelinux8.0tosomelinux9.
- Notethat"update"worksoninstalledpackagesfirst,andonlyiftherearenomatchesdoesitlookforavailablepackages.Thedifferenceismostnoticeablewhenyoudo"updatefoo-1-2"whichwillactexactlyas"updatefoo"iffoo-1-2isinstalled.Youcanusethe"update-to"ifyou’dpreferthatnothinghappenintheabovecase.
- yumupgrade:
- Installed:
- kernel.x86_640:2.6.32-504.12.2.el6
- DependencyInstalled:
- libtasn1.x86_640:2.3-6.el6_5p11-kit.x86_640:0.18.5-2.el6_5.2p11-kit-trust.x86_640:0.18.5-2.el6_5.2
- pkgconfig.x86_641:0.23-9.1.el6shared-mime-info.x86_640:0.70-6.el6
- Updated:
- audit.x86_640:2.3.7-5.el6audit-libs.x86_640:2.3.7-5.el6
- authconfig.x86_640:6.1.12-19.el6bash.x86_640:4.1.2-29.el6
- binutils.x86_640:2.20.51.0.2-5.42.el6ca-certificates.noarch0:2014.1.98-65.1.el6
- centos-release.x86_640:6-6.el6.centos.12.2chkconfig.x86_640:1.3.49.3-2.el6_4.1
- coreutils.x86_640:8.4-37.el6coreutils-libs.x86_640:8.4-37.el6
- cpio.x86_640:2.10-12.el6_5cronie.x86_640:1.4.4-12.el6
- cronie-anacron.x86_640:1.4.4-12.el6cryptsetup-luks.x86_640:1.2.0-11.el6
- cryptsetup-luks-libs.x86_640:1.2.0-11.el6curl.x86_640:7.19.7-40.el6_6.4
- cyrus-sasl.x86_640:2.1.23-15.el6_6.1cyrus-sasl-lib.x86_640:2.1.23-15.el6_6.1
- db4.x86_640:4.7.25-18.el6_4db4-utils.x86_640:4.7.25-18.el6_4
- dbus-glib.x86_640:0.86-6.el6device-mapper.x86_640:1.02.90-2.el6_6.1
- device-mapper-event.x86_640:1.02.90-2.el6_6.1device-mapper-event-libs.x86_640:1.02.90-2.el6_6.1
- device-mapper-libs.x86_640:1.02.90-2.el6_6.1device-mapper-multipath.x86_640:0.4.9-80.el6_6.3
- device-mapper-multipath-libs.x86_640:0.4.9-80.el6_6.3device-mapper-persistent-data.x86_640:0.3.2-1.el6
- dhclient.x86_6412:4.1.1-43.P1.el6.centos.1dhcp-common.x86_6412:4.1.1-43.P1.el6.centos.1
- dracut.noarch0:004-356.el6_6.1dracut-kernel.noarch0:004-356.el6_6.1
- e2fsprogs.x86_640:1.41.12-21.el6e2fsprogs-libs.x86_640:1.41.12-21.el6
- efibootmgr.x86_640:0.5.4-12.el6elfutils-libelf.x86_640:0.158-3.2.el6
- ethtool.x86_642:3.5-5.el6file.x86_640:5.04-21.el6
- file-libs.x86_640:5.04-21.el6glib2.x86_640:2.28.8-4.el6
- gnupg2.x86_640:2.0.14-8.el6grep.x86_640:2.6.3-6.el6
- grub.x86_641:0.97-93.el6grubby.x86_640:7.0.15-7.el6
- gzip.x86_640:1.3.12-22.el6hwdata.noarch0:0.233-11.1.el6
- initscripts.x86_640:9.03.46-1.el6.centos.1iproute.x86_640:2.6.32-33.el6_6
- iptables.x86_640:1.4.7-14.el6iptables-ipv6.x86_640:1.4.7-14.el6
- iputils.x86_640:20071127-17.el6_4.2iscsi-initiator-utils.x86_640:6.2.0.873-13.el6
- kernel-firmware.noarch0:2.6.32-504.12.2.el6keyutils-libs.x86_640:1.4-5.el6
- kpartx.x86_640:0.4.9-80.el6_6.3krb5-libs.x86_640:1.10.3-33.el6
- less.x86_640:436-13.el6libblkid.x86_640:2.17.2-12.18.el6
- libcom_err.x86_640:1.41.12-21.el6libcurl.x86_640:7.19.7-40.el6_6.4
- libdrm.x86_640:2.4.52-4.el6libgcrypt.x86_640:1.4.5-11.el6_4
- libpciaccess.x86_640:0.13.3-0.1.el6libselinux.x86_640:2.0.94-5.8.el6
- libselinux-utils.x86_640:2.0.94-5.8.el6libss.x86_640:1.41.12-21.el6
- libssh2.x86_640:1.4.2-1.el6_6.1libudev.x86_640:147-2.57.el6
- libuuid.x86_640:2.17.2-12.18.el6libxml2.x86_640:2.7.6-17.el6_6.1
- logrotate.x86_640:3.7.8-17.el6lvm2.x86_640:2.02.111-2.el6_6.1
- lvm2-libs.x86_640:2.02.111-2.el6_6.1mdadm.x86_640:3.3-6.el6_6.1
- module-init-tools.x86_640:3.9-24.el6mysql-libs.x86_640:5.1.73-3.el6_5
- nspr.x86_640:4.10.6-1.el6_5nss.x86_640:3.16.2.3-3.el6_6
- nss-softokn.x86_640:3.14.3-22.el6_6nss-softokn-freebl.x86_640:3.14.3-22.el6_6
- nss-sysinit.x86_640:3.16.2.3-3.el6_6nss-tools.x86_640:3.16.2.3-3.el6_6
- nss-util.x86_640:3.16.2.3-2.el6_6openldap.x86_640:2.4.39-8.el6
- openssh.x86_640:5.3p1-104.el6_6.1openssh-clients.x86_640:5.3p1-104.el6_6.1
- openssh-server.x86_640:5.3p1-104.el6_6.1pam.x86_640:1.1.1-20.el6
- pciutils-libs.x86_640:3.1.10-4.el6plymouth.x86_640:0.8.3-27.el6.centos.1
- plymouth-core-libs.x86_640:0.8.3-27.el6.centos.1plymouth-scripts.x86_640:0.8.3-27.el6.centos.1
- policycoreutils.x86_640:2.0.83-19.47.el6_6.1postfix.x86_642:2.6.6-6.el6_5
- procps.x86_640:3.2.8-30.el6psmisc.x86_640:22.6-19.el6_5
- python.x86_640:2.6.6-52.el6python-libs.x86_640:2.6.6-52.el6
- python-urlgrabber.noarch0:3.9.1-9.el6rpm.x86_640:4.8.0-38.el6_6
- rpm-libs.x86_640:4.8.0-38.el6_6rpm-python.x86_640:4.8.0-38.el6_6
- rsyslog.x86_640:5.8.10-10.el6_6selinux-policy.noarch0:3.7.19-260.el6_6.2
- selinux-policy-targeted.noarch0:3.7.19-260.el6_6.2setup.noarch0:2.8.14-20.el6_4.1
- shadow-utils.x86_642:4.1.4.2-19.el6sudo.x86_640:1.8.6p3-15.el6
- system-config-firewall-base.noarch0:1.2.27-7.2.el6_6sysvinit-tools.x86_640:2.87-5.dsf.el6
- tzdata.noarch0:2015a-1.el6udev.x86_640:147-2.57.el6
- upstart.x86_640:0.6.5-13.el6_5.3util-linux-ng.x86_640:2.17.2-12.18.el6
- xfsprogs.x86_640:3.1.1-16.el6xz-libs.x86_640:4.999.9-0.5.beta.20091007git.el6
- yum.noarch0:3.2.29-60.el6.centosyum-plugin-fastestmirror.noarch0:1.1.30-30.el6
- Complete!
- [root@localhost~]#reboot
- [root@localhost~]#uname-a
- Linuxlocalhost.localdomain2.6.32-504.12.2.el6.x86_64#内核升级了!
- [root@localhost~]#cat/etc/redhat-release
- CentOSrelease6.6(Final)
- yumupdate:
- Installed:
- kernel.x86_640:2.6.32-504.12.2.el6
- DependencyInstalled:
- libtasn1.x86_640:2.3-6.el6_5p11-kit.x86_640:0.18.5-2.el6_5.2p11-kit-trust.x86_640:0.18.5-2.el6_5.2
- pkgconfig.x86_641:0.23-9.1.el6shared-mime-info.x86_640:0.70-6.el6
- Updated:
- audit.x86_640:2.3.7-5.el6audit-libs.x86_640:2.3.7-5.el6
- authconfig.x86_640:6.1.12-19.el6bash.x86_640:4.1.2-29.el6
- binutils.x86_640:2.20.51.0.2-5.42.el6ca-certificates.noarch0:2014.1.98-65.1.el6
- centos-release.x86_640:6-6.el6.centos.12.2chkconfig.x86_640:1.3.49.3-2.el6_4.1
- coreutils.x86_640:8.4-37.el6coreutils-libs.x86_640:8.4-37.el6
- cpio.x86_640:2.10-12.el6_5cronie.x86_640:1.4.4-12.el6
- cronie-anacron.x86_640:1.4.4-12.el6cryptsetup-luks.x86_640:1.2.0-11.el6
- cryptsetup-luks-libs.x86_640:1.2.0-11.el6curl.x86_640:7.19.7-40.el6_6.4
- cyrus-sasl.x86_640:2.1.23-15.el6_6.1cyrus-sasl-lib.x86_640:2.1.23-15.el6_6.1
- db4.x86_640:4.7.25-18.el6_4db4-utils.x86_640:4.7.25-18.el6_4
- dbus-glib.x86_640:0.86-6.el6device-mapper.x86_640:1.02.90-2.el6_6.1
- device-mapper-event.x86_640:1.02.90-2.el6_6.1device-mapper-event-libs.x86_640:1.02.90-2.el6_6.1
- device-mapper-libs.x86_640:1.02.90-2.el6_6.1device-mapper-multipath.x86_640:0.4.9-80.el6_6.3
- device-mapper-multipath-libs.x86_640:0.4.9-80.el6_6.3device-mapper-persistent-data.x86_640:0.3.2-1.el6
- dhclient.x86_6412:4.1.1-43.P1.el6.centos.1dhcp-common.x86_6412:4.1.1-43.P1.el6.centos.1
- dracut.noarch0:004-356.el6_6.1dracut-kernel.noarch0:004-356.el6_6.1
- e2fsprogs.x86_640:1.41.12-21.el6e2fsprogs-libs.x86_640:1.41.12-21.el6
- efibootmgr.x86_640:0.5.4-12.el6elfutils-libelf.x86_640:0.158-3.2.el6
- ethtool.x86_642:3.5-5.el6file.x86_640:5.04-21.el6
- file-libs.x86_640:5.04-21.el6glib2.x86_640:2.28.8-4.el6
- gnupg2.x86_640:2.0.14-8.el6grep.x86_640:2.6.3-6.el6
- grub.x86_641:0.97-93.el6grubby.x86_640:7.0.15-7.el6
- gzip.x86_640:1.3.12-22.el6hwdata.noarch0:0.233-11.1.el6
- initscripts.x86_640:9.03.46-1.el6.centos.1iproute.x86_640:2.6.32-33.el6_6
- iptables.x86_640:1.4.7-14.el6iptables-ipv6.x86_640:1.4.7-14.el6
- iputils.x86_640:20071127-17.el6_4.2iscsi-initiator-utils.x86_640:6.2.0.873-13.el6
- kernel-firmware.noarch0:2.6.32-504.12.2.el6keyutils-libs.x86_640:1.4-5.el6
- kpartx.x86_640:0.4.9-80.el6_6.3krb5-libs.x86_640:1.10.3-33.el6
- less.x86_640:436-13.el6libblkid.x86_640:2.17.2-12.18.el6
- libcom_err.x86_640:1.41.12-21.el6libcurl.x86_640:7.19.7-40.el6_6.4
- libdrm.x86_640:2.4.52-4.el6libgcrypt.x86_640:1.4.5-11.el6_4
- libpciaccess.x86_640:0.13.3-0.1.el6libselinux.x86_640:2.0.94-5.8.el6
- libselinux-utils.x86_640:2.0.94-5.8.el6libss.x86_640:1.41.12-21.el6
- libssh2.x86_640:1.4.2-1.el6_6.1libudev.x86_640:147-2.57.el6
- libuuid.x86_640:2.17.2-12.18.el6libxml2.x86_640:2.7.6-17.el6_6.1
- logrotate.x86_640:3.7.8-17.el6lvm2.x86_640:2.02.111-2.el6_6.1
- lvm2-libs.x86_640:2.02.111-2.el6_6.1mdadm.x86_640:3.3-6.el6_6.1
- module-init-tools.x86_640:3.9-24.el6mysql-libs.x86_640:5.1.73-3.el6_5
- nspr.x86_640:4.10.6-1.el6_5nss.x86_640:3.16.2.3-3.el6_6
- nss-softokn.x86_640:3.14.3-22.el6_6nss-softokn-freebl.x86_640:3.14.3-22.el6_6
- nss-sysinit.x86_640:3.16.2.3-3.el6_6nss-tools.x86_640:3.16.2.3-3.el6_6
- nss-util.x86_640:3.16.2.3-2.el6_6openldap.x86_640:2.4.39-8.el6
- openssh.x86_640:5.3p1-104.el6_6.1openssh-clients.x86_640:5.3p1-104.el6_6.1
- openssh-server.x86_640:5.3p1-104.el6_6.1pam.x86_640:1.1.1-20.el6
- pciutils-libs.x86_640:3.1.10-4.el6plymouth.x86_640:0.8.3-27.el6.centos.1
- plymouth-core-libs.x86_640:0.8.3-27.el6.centos.1plymouth-scripts.x86_640:0.8.3-27.el6.centos.1
- policycoreutils.x86_640:2.0.83-19.47.el6_6.1postfix.x86_642:2.6.6-6.el6_5
- procps.x86_640:3.2.8-30.el6psmisc.x86_640:22.6-19.el6_5
- python.x86_640:2.6.6-52.el6python-libs.x86_640:2.6.6-52.el6
- python-urlgrabber.noarch0:3.9.1-9.el6rpm.x86_640:4.8.0-38.el6_6
- rpm-libs.x86_640:4.8.0-38.el6_6rpm-python.x86_640:4.8.0-38.el6_6
- rsyslog.x86_640:5.8.10-10.el6_6selinux-policy.noarch0:3.7.19-260.el6_6.2
- selinux-policy-targeted.noarch0:3.7.19-260.el6_6.2setup.noarch0:2.8.14-20.el6_4.1
- shadow-utils.x86_642:4.1.4.2-19.el6sudo.x86_640:1.8.6p3-15.el6
- system-config-firewall-base.noarch0:1.2.27-7.2.el6_6sysvinit-tools.x86_640:2.87-5.dsf.el6
- tzdata.noarch0:2015a-1.el6udev.x86_640:147-2.57.el6--phpfensi.com
- upstart.x86_640:0.6.5-13.el6_5.3util-linux-ng.x86_640:2.17.2-12.18.el6
- xfsprogs.x86_640:3.1.1-16.el6xz-libs.x86_640:4.999.9-0.5.beta.20091007git.el6
- yum.noarch0:3.2.29-60.el6.centosyum-plugin-fastestmirror.noarch0:1.1.30-30.el6
- Complete!
- [root@localhost~]#uname-a
- Linuxlocalhost.localdomain2.6.32-504.12.2.el6.x86_64#1SMPWedMar1122:03:14UTC2015x86_64x86_64x86_64GNU/Linux
- [root@localhost~]#cat/etc/redhat-release
- CentOSrelease6.6(Final)
结论:Centos6.4 升级到 Centos6.6 貌似 yum update 和 yum upgrade 均可.
热门评论