CentOS中的 yum upgrade 和 yum update 的区别
通过 man yum 的帮助信息了解 yum update 和 yum 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 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.
upgrade
Is the same as the update command with the --obsoletes flag set. See update for more details.
从帮助信息我们可以看到,upgrade 与 update --obsoletes 是一样的。
然而,update 即使不附带 --obsoletes 选项时,在默认的配置中已经将其设置为true(开启),在 /etc/yum.conf 文件中可以查看到默认的配置信息:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
就是说默认情况下 update 和 upgrade 没有区别,都是将系统包更新到最新的版本并且强制删除过时的老版本,并且都会升级内核版本,这种更新操作是危险的,因为可能有些运行中的服务仍旧依赖着旧版本。
因此我们可以修改默认配置,sed -i 's/obsoletes=1/obsoletes=0/' /etc/yum.conf,从而使update在进行系统包更新时保留旧版本。
如果我们不想升级内核版本,还需要添加 echo exclude=kernel* >> /etc/yum.conf。
参考:
CentOS中的 yum upgrade 和 yum update 的区别的更多相关文章
- Linux中升级更新命令yum upgrade和yum update的区别
区别 Linux升级命令有两个分别是yum upgrade和yum update, 这个两个命令是有区别的: 代码如下: yum -y update #升级所有包,同时也升级软件和系统内核 yum - ...
- yum upgrade和yum update的区别
Linux升级命令有两个分别是yum upgrade和yum update, 这个两个命令是有区别的: yum -y update 升级所有包同时也升级软件.系统版本和系统内核 yum -y upgr ...
- Linux升级命令yum upgrade和yum update的区别
Linux升级命令有两个分别是yum upgrade和yum update, 这个两个命令是有区别的: yum -y update 升级所有包同时也升级软件和系统内核 yum -y upgrade 只 ...
- CentOS下的yum upgrade和yum update区别
说明:生产环境对软件版本和内核版本要求非常精确,别没事有事随便的进行yum update操作!! ! yum update:升级所有包同时也升级软件和系统内核 yum upgrade:只升级所有包,不 ...
- CentOS下的yum upgrade和yum update区别,没事别乱用,和Ubuntu的update不一样!
说明:生产环境对软件版本和内核版本要求非常精确,别没事有事随便的进行yum update操作!!!!!!!!! yum update:升级所有包同时也升级软件和系统内核 yum upgrade:只升级 ...
- centos中python2.7被覆盖,yum,python重新安装
参考如下,问题以解决,绝对有效 下载链接yum和python2.7网盘 链接:https://pan.baidu.com/s/1sC2crFW1I8F7zndJU0jjcA 提取码:5kia 直接参考 ...
- Centos下yum update与yum upgrade的区别
转载来源于:http://www.cnblogs.com/EasonJim/p/9026357.html 说明:生产环境对软件版本和内核版本要求非常精确,别没事有事随便的进行yum update操作! ...
- ubuntu中apt使用以及centos中yum的使用
centos和ubuntu是两大linux主流阵营 在centos中下载安装软件的方式 rpm rpm命令是RPM软件包的管理工具.rpm原本是Red Hat Linux发行版专门用来管理Linux各 ...
- <亲测>CentOS中yum安装ffmpeg
CentOS中yum安装ffmpeg 1.升级系统 sudo yum install epel-release -y sudo yum update -y sudo shutdown -r now 2 ...
随机推荐
- python SQLAchemy多外键关联
关联同一张表的两个字段 Customer表有2个字段都关联了Address表 创建表结构 orm_many_fk.py 只创建表结构 from sqlalchemy import Integer, F ...
- 解决 sourcetree git ssh私钥问题
最近遇到个问题,git仓库用gitbash,更新和提交都是没问题的,用界面化工具SourceTree就一直提示下面信息: git -c diff.mnemonicprefix=false -c cor ...
- Myeclipes连接Mysql数据库配置
相信大家在网站上也找到了许多关于myeclipes如何连接mysql数据库的解决方案,虽然每一步都按照他的步骤来,可到最后还是提示连接失败,有的方案可能应个人设备而异,配置环境不同导致.经过个人多方探 ...
- Eclipse编码格式
来源:http://e-ant.javaeye.com/blog/177579 如果要使插件开发应用能有更好的国际化支持,能够最大程度的支持中文输出,则最好使 Java文件使用UTF-8编码.然而,E ...
- php 汉字转拼音函数
function Pinyin($_String, $_Code='UTF8'){ //GBK页面可改为gb2312,其他随意填写为UTF8 $_DataKey = "a|ai|an|ang ...
- 如何给Docker hub用户上传头像
我第一次使用Docker hub时,觉得很奇怪,这个网站上面没有允许用户上传头像的地方. 后来经过研究才发现,需要用在Docker hub上注册用户的同一个邮箱到Gravatar这个网站上再注册一个账 ...
- Chosen三级联动
上一篇介绍了 Chosen 的使用,这篇介绍联动.看代码: var addressResolve = function (options) { //检测用户传进来的参数是否合法 if (!isVal ...
- C#检验IIS版本、SQL Server版本、SilverLight版本
之前做一个小项目,使用C#检验这些软件的版本,到处找了一些代码,也能作用,记录一下,以防以后用到. 一.检验IIS版本 public static bool checkIIS(string destV ...
- Spring 整合Hibernate 示例
虽然Spring整合Hibernate早就会了,但经常在创建项目整合这两个框架的时候出一些低级错误.所以在这里写一个示例,以后再遇到错误时,再把遇到的错误或异常添加上. 一.创建一个动态WEB工程,添 ...
- xalan\xalan\2.7.2\xercesImpl.jar (系统找不到指定的文件)问题
本文转自:http://blog.csdn.net/lveliu/article/details/77772828 环境搭建为:maven+tomcat tomcat 8.5.2 以上会出现改问题(包 ...