How do we rename a rpm build?

冷暖自知 提交于 2019-12-11 12:57:02

问题


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

it throws the following error:

file XXXXX from install of oldname-7.x86_64 conflicts with file from package newname-8.x86_64.

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?


回答1:


You should use the Obsoletes and/or Provides tags in your spec file of newname.spec:

Obsoletes: oldname

and optionally even:

Provides: oldname = %{version}-%{release}

You can read http://rpm.org/user_doc/dependencies.html for further reference.



来源:https://stackoverflow.com/questions/51361306/how-do-we-rename-a-rpm-build

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!