如何在安装新 rpm 期间卸载 rpm

发布于 2024-09-15 07:27:50 字数 309 浏览 2 评论 0原文

对于基于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此刻的回忆 2024-09-22 07:27:50

处理这个问题的正确方法是将其包含

Obsoletes: package1

在您的 package2 规范中。通过 yum 安装时,package1 会自动卸载。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文