rpm中config,config(noreplace)区别

简介: 问题描述最近才知道公司安装新版本,不是rpm -e卸载再rpm -ivh安装,而是rpm -Uvh直接升级,导致了安装包里有些文件没有覆盖原有文件。解决方法找config,config(noreplace)的原理说明,http://people.

问题描述

最近才知道公司安装新版本,不是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即可。

目录
相关文章
|
4月前
|
XML 前端开发 Java
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
35 0
Vue.config.js中configureWebpack和chainWebpack的区别
Vue.config.js中configureWebpack和chainWebpack的区别
286 0
|
1月前
|
Java 数据库连接 开发工具
web后端-SpringCloud-Config分布配置
web后端-SpringCloud-Config分布配置
|
2月前
|
API
在vite.config.js 配置代理
在vite.config.js 配置代理
67 2
|
4月前
|
API
vite.config.js 的一些常用配置
vite.config.js 的一些常用配置
105 1
|
7天前
|
JavaScript
vue.config.ts配置环境变量
vue.config.ts配置环境变量
12 0
|
1月前
|
移动开发 监控 小程序
mPaaS常见问题之uniapp ios端云打包的配置config文件如何解决
mPaaS(移动平台即服务,Mobile Platform as a Service)是阿里巴巴集团提供的一套移动开发解决方案,它包含了一系列移动开发、测试、监控和运营的工具和服务。以下是mPaaS常见问题的汇总,旨在帮助开发者和企业用户解决在使用mPaaS产品过程中遇到的各种挑战
25 0
|
1月前
|
消息中间件 SpringCloudAlibaba Java
【Springcloud Alibaba微服务分布式架构 | Spring Cloud】之学习笔记(八)Config服务配置+bus消息总线+stream消息驱动+Sleuth链路追踪
【Springcloud Alibaba微服务分布式架构 | Spring Cloud】之学习笔记(八)Config服务配置+bus消息总线+stream消息驱动+Sleuth链路追踪
782 0

热门文章

最新文章