我们如何重命名 rpm 构建? [英] How do we rename a rpm build?
问题描述
我想将 rpm 文件的名称从 oldname-7.x86_64.rpm 更改为 newname-8.x86_64.rpm.我用新名称创建了新的 rpm,但是当我尝试执行
I wanted to change the name of my rpm file from oldname-7.x86_64.rpm to newname-8.x86_64.rpm. I created the new rpm with the new name but when I try to execute
rpm -Uvh newname-8.x86_64.rpm
它抛出以下错误:
file XXXXX from install of oldname-7.x86_64 conflicts with file from package newname-8.x86_64.
rpm upgrade 删除包并安装新包.但在我的情况下,包名称不同,所以它不会删除包.我应该在 %pre 部分使用 rpm -e oldname 删除 oldname 项目吗?有没有办法在 %pre 部分设置旧名称?
rpm upgrade removes the package and install the new package. But in my case package name is different so it is not removing the package. Should I remove the oldname project using rpm -e oldname in the %pre section? Is there any way to set the old name in the %pre section?
推荐答案
您应该在 newname.spec 的规范文件中使用 Obsoletes
和/或 Provides
标签:
You should use the Obsoletes
and/or Provides
tags in your spec file of newname.spec:
Obsoletes: oldname
甚至可选:
Provides: oldname = %{version}-%{release}
您可以阅读http://rpm.org/user_doc/dependencies.html进一步参考.
You can read http://rpm.org/user_doc/dependencies.html for further reference.
这篇关于我们如何重命名 rpm 构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!