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?
You should use the
Obsoletes
and/orProvides
tags in your spec file of newname.spec:and optionally even:
You can read http://rpm.org/user_doc/dependencies.html for further reference.