如何在安装新 rpm 期间卸载 rpm
对于基于 rpm 的系统,我需要在安装新包时用另一个包更改一个包。 fg,安装package2.rpm 将卸载package1.rpm 并继续稍微安装。 为此,我计划在安装 package2 时删除 package1,并在 package2.rpm 的 %pre 部分调用 rpm -e。 但我无法确定 rpm 是否会在 rpm 数据库工作后或安装进度开始之前锁定 rpm 数据库。遗憾的是,由于目前这只是一个概念问题,我没有任何 Linux 系统可以快速尝试。 是否可以在 %pre 部分使用 rpm -e ?或者有什么方法可以用单个 rpm 包来做到这一点,因为我必须将该包作为 rpm 包分发。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
处理这个问题的正确方法是将其包含
在您的 package2 规范中。通过 yum 安装时,package1 会自动卸载。
The correct way to handle this would be to include
in your package2 spec. When it is installed through yum package1 will be uninstalled automatically.