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月前
|
JSON JavaScript 前端开发
vue2_vite.config.js的proxy跨域配置和nginx配置代理有啥区别?
vue2_vite.config.js的proxy跨域配置和nginx配置代理有啥区别?
110 1
|
9月前
|
XML 前端开发 Java
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
50 0
Vue.config.js中configureWebpack和chainWebpack的区别
Vue.config.js中configureWebpack和chainWebpack的区别
311 0
|
14天前
|
移动开发 JavaScript 前端开发
UniApp H5 跨域代理配置并使用(配置manifest.json、vue.config.js)
这篇文章介绍了在UniApp H5项目中处理跨域问题的两种方法:通过修改manifest.json文件配置h5设置,或在项目根目录创建vue.config.js文件进行代理配置,并提供了具体的配置代码示例。
UniApp H5 跨域代理配置并使用(配置manifest.json、vue.config.js)
|
22天前
|
JSON 前端开发 JavaScript
vue.config.js配置详解
【8月更文挑战第16天】vue.config.js配置详解
25 1
vue.config.js配置详解
|
18天前
|
Web App开发 安全 JavaScript
【Azure 应用服务】App Service 通过配置web.config来添加请求返回的响应头(Response Header)
【Azure 应用服务】App Service 通过配置web.config来添加请求返回的响应头(Response Header)
|
18天前
|
缓存 NoSQL 网络协议
【Azure Redis 缓存】如何使得Azure Redis可以仅从内网访问? Config 及 Timeout参数配置
【Azure Redis 缓存】如何使得Azure Redis可以仅从内网访问? Config 及 Timeout参数配置
|
19天前
|
JavaScript Java Python
【Azure 应用服务】在Azure App Service for Windows 中部署Java/NodeJS/Python项目时,web.config的配置模板内容
【Azure 应用服务】在Azure App Service for Windows 中部署Java/NodeJS/Python项目时,web.config的配置模板内容