Questions for running 'rpm' -e in %pre

FlorianFesti ffesti at redhat.com
Mon Jun 21 16:08:17 UTC 2010


On 04/29/2010 09:03 AM, WangXinpeng wrote:
> Hi,
>    I have a question what about running 'rpm' command in the script of %pre.
>    Now, I need create a RPM package to upgrade the old version of our product to newest version. At first, we should backup old configuration and uninstall old version of our product. so, I write the script in %pre to run 'rpm -e XXX'.
>    
In general this should not be necessary. You can do the backup of the 
data within the %pre script of the new version. If the package gets 
updated the old version is removed afterwards. RPM takes care that only 
left over files get deleted and the new ones stay.

Of course you can get into trouble if the old packges is broken. If you 
explain your actual problem we might come up with another solution than 
calling rpm -e.

Florian


More information about the Rpm-list mailing list