在安装已淘汰另一个RPM的RPM时如何检测升级 [英] How to detect upgrade when an RPM that obsoletes another RPM is being installed

查看:115
本文介绍了在安装已淘汰另一个RPM的RPM时如何检测升级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RPM脚本集在 $ 1 中传递(此名称的软件包将在操作完成后保留在系统上(),以便他们确定是否正在升级或删除软件包。由于我无法控制的原因,我相信该软件包的下一版本可能与第一版本具有不同的软件包名称。我试图创建一个新的包,该包已过时 一并使用它进行升级。但是,旧软件包postun scriptlet仍然有$ 1 == 0并且我的postun cleanup脚本运行了。

RPM scriptlets are passed in $1 ( the number of packages of this name which will be left on the system when the action completes ) so they can determine whether a package upgrade or removal is occurring. For reasons outside my control, I believe the next version of the package may have a different package name than the first version. I tried to create a new package that "obsoletes" the old one and upgraded using it. However, the old package postun scriptlet still got $1 == 0 and my postun cleanup script ran.

这有点极端,因为从技术上讲,有0个软件包保留了该名称,但我认为过时的案例可能会假装在升级过程中仍然存在具有该名称的软件包。有没有一种方法可以测试软件包被废弃时的情况,以便脚本可以确定正在升级而不是删除软件包?

This is a bit of an edge case, because technically there are 0 packages with that name remaining, but I thought the obsoletes case might pretend that there's still a package with that name during the upgrade. Is there a way to test for the situation when a package is being obsoleted so that the scriptlet can determine an upgrade is occurring instead of a package removal?

推荐答案

您可以尝试使用此命令来检查操作系统中的rpm软件包吗?

Can you try this command to check the rpm packages in the OS

rpm -qa | grep -i((RPMNAME)]

rpm -qa | grep -i "(RPMNAME)"

这篇关于在安装已淘汰另一个RPM的RPM时如何检测升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆