问题
I'm working on a bug in our rpm scriptlets which is probably originating from order in which our scriptlets are executed during package install/removal/upgrade. We are using yum on Redhat Enterprise.
Obviously I first need a good understanding of the order of the rpm scriptlets - and interestingly enough I have not found a good summary of this anywhere.
From what I gather this is the scriptlet ordering for upgrades:
%pretransof new package%preof new packageprein- package install
%postof new packagepostin%preunof old package- removal of old package
%postunof old package%posttransof new package
However it doesn't list the scriptlet orderings for installing a new package not previously on the system (i.e. not an upgrade) and for removing one? From the above ordering I am able to guess how these orderings might look, but I'd like to get some educated opinion on this as well...
回答1:
Package order for installing a single package for the first time:
%pretransof new package%preof new package- package install
%postof new package%posttransof new package
Package order for removing a single package:
%preunof old package- removal of old package
%postunof old package
回答2:
If you are installing two different packages at once (e.g. primary, secondary ), where one depends on the other (secondary requires primary), the order is:
%pretransofprimary%pretransofsecondary%preofprimary- installation of
primary %postofprimary%preofsecondary- installation of
secondary %postofsecondary%posttransofprimary%posttransofsecondary
When removing these packages at once, the order is:
%preunofsecondary- removal of
secondary %postunofsecondary%preunofprimary- removal of
primary $postunofprimary
回答3:
Your educated guess is correct - only the steps that are relevant.
来源:https://stackoverflow.com/questions/22456217/rpm-scriptlet-ordering-for-install-remove-upgrade-using-yum