Questions for running 'rpm' -e in %pre

devzero2000 pinto.elia at gmail.com
Mon Jun 21 12:25:21 UTC 2010


On Thu, Apr 29, 2010 at 9:03 AM, WangXinpeng <wangxp at xa.nec-as.nec.com.cn>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'.
>
IMHO, not exactly a nice thing to do : better to package your application in
first place for this example.

BTW, perhaps this links could be useful to you - i hope i can put this refs
here -

http://rpm5.org/community/rpm-users/0263.html

It is trivial to convert this toy spec in what do you want probably

http://rpm5.org/community/rpm-users/att-0263/yum-pull-update.tar.gz

But beware that many on this list think  it is very dangerous to do what
you're doing, as calling rpm inside an rpm could compromise the rpmdb, for
many reasons, repeated countless times. Search "rpm package bundle" if you
are interested.

hth




>  It could be run on Redhat 3 but not Redhat 5. And follow message had been
> displayed in command line.
>  "warning: waiting for transaction lock on /var/lib/rpm/__db.000"
>  And follow messages had been shown after pressed Ctrl-C.
>  "error: can't create transaction lock on /var/lib/rpm/__db.000"
>
>  I searched it on the web. Most answers are rpm only could be run one
> instance in the same time. But, why the rpm of redhat 3 (R4.2.3) could do
> it, but not on Redhat 5(R4.4.2.3). By the way, I tested it on Fedora 12 with
> RPM 4.7.1. It  also could not be done..
>
>  It could not be done from which RPM version? And why it changed? How to do
> it if I want to uninstall the old version of our product before install the
> new version of our product?
>
>  I am sorry for my bad english.
>  Thanks a lot!
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20100621/121028ad/attachment.html>


More information about the Rpm-list mailing list