我可以从 .spec 脚本部分中删除 RPM 吗?

发布于 2024-11-29 06:14:44 字数 534 浏览 4 评论 0原文

我正在构建现有 .spec/rpm 的新版本,并且我想删除不再需要的依赖项(以前的 .spec 具有“需要:rpm-xyz)。

因此,除了删除需要之外: rpm-xyz,我在 .spec 文件的“%post”部分添加了以下内容:

rpm -e rpm-xyz

当我使用 yum 安装生成的 rpm 时,下载后要求我确认。处理后,我得到这一行,它永远卡在那里:

warning: waiting for transaction lock on /var/lib/rpm/__db.000

所以对我来说这看起来像是一个死锁(yum 调用 rpm,然后从内部调用 rpm)。我在 /var/lib/rpm 中有 __db.oox 文件,我需要重建 rom 数据库以删除它们,

所以问题是:我是否允许从我读过的规范文件中调用 rpm 命令?过时的标签,但它不会删除 rpm。删除 rpm 的最佳方法是什么?

谢谢,

-Martin

P.S. 额外信息:是的,我需要删除旧的依赖项,不,没有其他 rpm 依赖它。

I'm building a new version of an existing .spec/rpm and I want to remove a dependency that was required by that is not anymore (previous .spec had "Requires: rpm-xyz).

So on top of removing the Requires: rpm-xyz, I added the following in the "%post" section of the .spec file:

rpm -e rpm-xyz.

When I install the generated rpm with yum, after downloading it and asked me the confirmation to processed, I get this line and it stuck there forever:

warning: waiting for transaction lock on /var/lib/rpm/__db.000

So it looks like a deadlock to me (yum calls rpm, then calls rpm from within). So I have __db.oox file in the /var/lib/rpm and I need to rebuild the rom database to removed them.

So the question is: Am I allow to call the rpm command from within a spec file? I've read on the Obsolete tags, but it does not remove rpm. What would be the best way to remove the rpm?

Thanks,

-Martin

P.S. Extra info: Yes, I need to remove old dependencies and no, no others rpm depend on it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

谁人与我共长歌 2024-12-06 06:14:44

不,您不能从 .spec 文件(无论是 %post 还是其他内容)的 scriptlet 中运行 rpm。 添加一行

Obsoletes: rpm-xyv <= VERSION

您可以做的就是在 .spec 文件中 。然后 Yum 将继续删除另一个包。

有关包重命名等操作的更多建议,请参阅 http://yum.baseurl.org/wiki/YumPackageUpdates

No, you cannot run rpm from within a scriptlet in your .spec file (whether %post, or something else). What you can do is put a line like

Obsoletes: rpm-xyv <= VERSION

in your .spec file. Yum will then proceed to remove the other package.

See http://yum.baseurl.org/wiki/YumPackageUpdates for more advice on what to do on package renames, etc.

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