rpm中config,config(noreplace)区别

问题描述

最近才知道公司安装新版本,不是rpm -e卸载再rpm -ivh安装,而是rpm -Uvh直接升级,导致了安装包里有些文件没有覆盖原有文件。

解决方法

找config,config(noreplace)的原理说明,http://people.ds.cam.ac.uk/jw35/docs/rpm_config.html 中有这样的总结:
In summary: if a file is not marked as a config file, or if a file has not been altered since installation, then it will be sliently replaced by the version from an update RPM. If a config file has been edited on disk, but is not actually different from one RPM to another then the edited version will be silently left in place. It is only when a config file has been edited and is different from one RPM to the next that what happens depens on the (noreplace) option. If absent, the new file will be installed, and the the old edited version will be renamed with a .rpmsave suffix. If present, the edited version will be left in place, and the new version will be installed with a .rpmnew suffix.
翻译总结如下:
总之,如果

  1. 一个文件没被标记,或者没被更改,会被新rpm包里的文件覆盖。
  2. 标记文件有被修改,但新旧rpm包的该文件是一样的,那么该文件不会被覆盖,保留修改后的文件。
  3. 新旧rpm包的该文件不同,则根据这文件的标记行事。
  • 文件被标记为%config,文件被覆盖为新版本文件,原修改后的文件保存为*.rpmsave。
  • 文件被标记为%config(noreplace),文件不会被覆盖,新rpm包里的文件被保存为 *.rpmnew.

之前我在rpm包里把文件标记为%config(noreplace),所以文件没替换掉原有的文件,将标记改为%config即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值