给定 rpm 包名称,查询 yum 数据库以获取更新
我正在想象一个 3 行 Python 脚本来完成此操作,但 yum Python API 难以理解。 这可能吗?
为“yum list package-name”编写包装器是执行此操作的唯一方法吗?
I was imagining a 3-line Python script to do this but the yum Python API is impenetrable. Is this even possible?
Is writing a wrapper for 'yum list package-name' the only way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://fpaste.org/paste/2453
并且有很多 yum api 的示例和一些指南在这里开始使用:
http://yum.baseurl.org/#DeveloperDocumentationExamples
http://fpaste.org/paste/2453
and there are many examples of the yum api and some guides to getting started with it here:
http://yum.baseurl.org/#DeveloperDocumentationExamples
正如 Seth 指出的,您可以使用更新 API 来询问是否有可用更新。 对于接近“yum list”的内容,您可能需要使用 doPackageLists()。 例如。
As Seth points out, you can use the updates APIs to ask if something is available as an update. For something that's close to what the "yum list" does you probably want to use the doPackageLists(). Eg.