Bug 30795 - Wrong rpm -U script run order
Wrong rpm -U script run order
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2001-03-06 05:28 EST by Péter, Soós
Modified: 2007-04-18 12:31 EDT (History)
0 users

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

Attachments (Terms of Use)

  None (edit)
Description Péter, Soós 2001-03-06 05:28:51 EST
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 09:01:12 EST
Yes, rpm installs before remove.

The order of script execution (including triggers) is in
Comment 2 Martin Craig 2004-11-18 06:31:55 EST
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.