我可以从 .spec 脚本部分中删除 RPM 吗?
我正在构建现有 .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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您不能从 .spec 文件(无论是 %post 还是其他内容)的 scriptlet 中运行 rpm。 添加一行
您可以做的就是在 .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
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.