如何只下载适合64位架构的包?
我使用的是 CentOS 7 64 位。我正在尝试使用 yumdownloader 下载多个软件包及其依赖项。然而,我面临着下载我不需要的软件包的问题。
当我使用 yum install
安装软件包时,仅安装一个软件包:x86_x64
(如果可用)或 i686
(如果 64 位不可用)或 noarch
。我试图模仿相同的行为,使用 yumdownloader 仅下载最匹配的包。然而,这并没有按预期工作,并且 x86_x64
和 i686
都在下载具有 2 种可用架构的软件包。添加 --archlist=x86_64
没有任何区别。在配置文件中设置 multilib_policy=best
也没有任何区别。
我还检查了 repoquery 工具。如果我设置 --archlist=x86_64
那么只会列出 x86_64
包。仅具有 i686
或 noarch
版本的版本将不会被选中。如果我设置 --archlist=x86_64,i686,noarch
那么结果类似于 yumdownloader
,即选择多个架构。
有没有办法只列出或下载最匹配的包?
我看到的唯一选择是完全手动完成 - 使用 repoquery
准备列表并删除重复项。但我更愿意找到更简洁、更稳健的方法。
I'm using CentOS 7 64bit. I'm trying to download multiple packages with their dependencies using yumdownloader
. However I'm facing the problem that packages that I do not need are getting downloaded.
When I'm installing a package using yum install <package>
only one package is getting installed: either x86_x64
(if available), or i686
(if 64bit is not available) or noarch
. I'm trying to mimic the same behavior to download only the best matching packages with yumdownloader
. However this does not work as expected and both x86_x64
and i686
are getting downloaded for packages that have 2 architectures available. Adding --archlist=x86_64
does not make any difference. Setting multilib_policy=best
in a config file does not make any difference either.
I also checked repoquery
tool. If I set --archlist=x86_64
then only x86_64
packags would be listed. Those that have only i686
or noarch
versions will not be picked up. If I set --archlist=x86_64,i686,noarch
then the result is similar to yumdownloader
, i.e. multiple architectures are being picked up.
Is there a way to list or download only best matching package?
The only option I see is to do it completely manually - prepare lists using repoquery
and remove duplicates. But I would prefer to find more neat and robust approach.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做的是使用标准 yum 选项来排除软件包。它是由
yumdownloader
“继承”的。示例:
请注意,由于 multilib,i686 是 x86_64 的“子集”,尤其适用于库(几乎所有库都有 i686 等效项)。确保您稍后不会有任何实际需要 i686 库的软件...我见过的此类仅限 i686 的软件的唯一值得注意的示例是 steam.i686(根本没有 x86_64 版本),但话又说回来了在 RHEL 上玩这个吗? (除了我自己)。
What you can do, is use the standard
yum
option for excluding packages. It is "inherited" byyumdownloader
.Example:
Note that i686 is sort of "subset" to x86_64 due to multilib, and especially applies to libraries (nearly all have i686 equivalent). Make sure you won't have any software that actually requires i686 libraries later on... The only notable example of such i686-only software I've seen is steam.i686 (there is simply no x86_64 version), but then again who plays that on RHEL? (aside from myself).