for an rpm based system, I need to change a package with another package while installing the new one. fg, installation of package2.rpm shall uninstall package1.rpm and continue its installation slightly. for this, I'm planning to erase package1 while installing package2 and call rpm -e at %pre section of package2.rpm. But I can not be sure if rpm locks the rpm database just after it works or just before installation progress start. Sadly, since this is a concept problem for now, I do not have any linux system to try it out quickly. Is it possible to use rpm -e at %pre section? or are there any way to do this with a single rpm package, because I would have to distribute the package as an rpm package.
A:
The correct way to handle this would be to include
Obsoletes: package1
in your package2 spec. When it is installed through yum package1 will be uninstalled automatically.
m1tk4
2010-08-24 03:36:21
thanks for the answer but I've no chance to use yum. Just basic RPM is allowed :(
goktan
2010-08-24 08:16:20
it will work through rpm command line as well.
m1tk4
2010-08-24 13:42:38