2

I have a rpm package which is already installed in the system. I want to replace the old package with the new package with a different package name. The "rpm -Uvh [package name]" should be enough to replace the old package with the new one.

After doing some research in the net I found that "Obsoletes" is used to obsolete an old package and replace it with a new package with a different name. I have used "Obsoletes" in my rpm spec file but When I am trying to upgrade from the old package the %preun of the old package gets called with $1 = 0 which I expected to be $1 = 1.

Please correct me if I am going wrong anywhere. Is there are any better solution for this problem?

Thanks

4

2 回答 2

1

Is there are any better solution for this problem?

rpm -e --nopreun <old-package> && rpm -i <new-package>

you can selectively enable and disable specific scripts with --no<scriptname>, or you can disable all scripts with --noscripts.

make sure you check the various scripts associated with the new package; you may have to disable some of them as well.

-steve

p.s. this would probably be a question better posted on ServerFault. :)

于 2009-06-19T13:41:34.683 回答
1

我对您的问题的理解是,旧包在其 %preun 脚本中做了一些您不希望它做的事情(比如删除用户帐户或类似的东西),对吧?

解决此问题的一种方法可能是创建不包含文件的旧包的中间虚拟 rpm 版本 N+1,升级到该版本,然后更新到最终的新包。

于 2009-06-16T23:39:56.673 回答