I am renaming my RPM package to a new name. I am using Obsolete tag for the old package. Obsoletes removes the old package after installing the new package. This is causing issue in my program. Is there anyway to remove the old package before installing the new package?
Asked
Active
Viewed 3,057 times
2 Answers
0
your question is not very clear. As I answered in your related question How do we rename a rpm build?, when using Obsoletes correctly, rpm
will automatically uninstall your old package while installing the new one.
Note that the uninstall and install don't happen in separate transactions. The scripts intermingle somewhat as written here: https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets

Chris Maes
- 35,025
- 12
- 111
- 136
-
When we use Obsoletes, rpm first installs the new package and then uninstalls the old package. I am starting the process after installing it and stopping the process while uninstalling. Here the issue is: it is installing first and then uninstalling so while uninstalling it is stopping the started process. – Sandy Jul 19 '18 at 13:12
-
I cannot control the uninstalling part as it is for the old package. Is there any way to uninstall the old package before installing new package Or is there any way to stop %preun execution for old package when it is unstalling – Sandy Jul 19 '18 at 13:13
-
Again, that question has already been asked here, and does not seem to have an easy solution: https://stackoverflow.com/questions/48070042/how-to-detect-upgrade-when-an-rpm-that-obsoletes-another-rpm-is-being-installed – Chris Maes Jul 19 '18 at 13:32
-
Removing the old package **after** that the new package has been installed is desirable if you want to migrate some files from the old version to the new one (for example you might want to import an old user configuration file into the new folder). – Bemipefe May 22 '19 at 15:11
-1
"Obsoletes
" uninstalls the old one after installation because that is the standard ordering of package upgrades.

Aaron D. Marasco
- 6,506
- 3
- 26
- 39