Bug 30795 - Wrong rpm -U script run order
Summary: Wrong rpm -U script run order
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 6.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-06 10:28 UTC by Péter, Soós
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-06 10:29:55 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Péter, Soós 2001-03-06 10:28:51 UTC
If you upgrade a package with %pre, %post, %preun, %postun, scripts by
command rpm -U package_name the uninstall scripts (e.g. %postun) of old
package runs after the install script of the new package. For example the
new package make changes in configuration files but the old removes them...

Reproducible: In some cases

Steps to Reproduce:
1. Get a package with scripts (e.g. vacation from contrib)
2. Install it
3. Build a new release
4. Upgrade it with rpm -U

User rpm -e after rpm -i to upgrade a package, but in case of more complex
package dependencies it is problematic.

Comment 1 Jeff Johnson 2001-03-06 14:01:12 UTC
Yes, rpm installs before remove.

The order of script execution (including triggers) is in

Comment 2 Martin Craig 2004-11-18 11:31:55 UTC
I'm surprised this is NOTABUG - I have just come across it myself and
the behaviour, although as documented, is very non-intuitive. 

In my case the postinstall script copies a file to a predefined
location and the postuninstall removes it. This means that on upgrade
the file is copied and then deleted by the removal of the old package!

Is there a workaround apart from not using rpm -U ?

Note You need to log in before you can comment on or make changes to this bug.