合适的存储库。 “架构”选项如何工作。如何确定可以使用哪个值?

合适的存储库。 “架构”选项如何工作。如何确定可以使用哪个值?

我正在使用 ansible 在我的 Ubuntu_22.04 节点上设置两个 apt 存储库。

在 ansible 中,有一个名为 {{ ansible_architecture }} 的 var,aarch64在本例中给出:

我用它为 podman 和 docker 设置了两个存储库DEB822 源格式。这些是 .sources 文件/etc/apt/sources.list.d/


X-Repolib-Name: podman
Signed-By: /etc/apt/keyrings/podman.asc
URIs: https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04
Suites: /
Architectures: aarch64
Enabled: yes
Types: deb
X-Repolib-Name: docker
Signed-By: /etc/apt/keyrings/docker.asc
URIs: https://download.docker.com/linux/ubuntu
Suites: jammy
Components: stable
Architectures: aarch64
Enabled: yes
Types: deb

Podman 仓库工作正常,但 docker 仓库需要arm64

N: Skipping acquire of configured file 'stable/binary-aarch64/Packages' as repository 'https://download.docker.com/linux/ubuntu jammy InRelease' doesn't support architecture 'aarch64'

所以我的问题是如何找出可以使用什么关键字来指定架构,因为 podman 接受aarch64但 docker requrire arm64Docker 页面表明两个名字都应该是正确的,但这是我发现的唯一的东西。是否可以仅通过 URI 来确定https://download.docker.com/linux/ubuntu/还是只有配置它的人知道,而我需要碰碰运气?

答案1

在 Debian 衍生版本中,64 位 ARM 的架构名称是arm64(也可以看看dpkg-deb 将我的架构视为 amd64 而不是 x86-64),所以这应该是使用的值。您可以通过查看存储库中的相关分发目录来确认任何给定存储库的这一点(例如,这里是 Docker)或在存储库文件的“Architectures”条目中Release这里是 Docker)。

在大多数情况下,您无论如何都不需要在存储库配置文件中指定“Architectures”条目。apt将自动获取与系统架构匹配的架构。

指定“架构”的主要原因是在配置有多种架构和不支持所有这些架构的存储库的系统上;看易于查找 i386 文件,即使架构是 amd64

相关内容