如何修复 APT Skipping acquire of configured file ... doesn't support architecture i386

问题

运行 apt update 时,你看到以下错误消息:

josm.openstreetmap.de
N: Skipping acquire of configured file 'universe/binary-i386/Packages' as repository 'https://josm.openstreetmap.de/apt noble InRelease' doesn't support architecture 'i386'

针对一个或多个仓库。

解决方案

你的包管理器配置为同时使用 amd64i386 仓库。你看到警告消息的仓库不支持 i386 架构,只为 amd64 提供包。

为了修复此问题,编辑 /etc/apt/sources.list.d 中的仓库文件。该目录中的文件名是用户自定义的,如果你找不到它,在该目录中 grep 仓库 URL。对于上面的示例:

find_repo_grep.sh
grep -r "https://josm.openstreetmap.de/apt" /etc/apt/sources.list.d

结果输出将在第一列告诉你正确的文件:

grep_output.txt
/etc/apt/sources.list.d/josm.list:deb [signed-by=/usr/local/share/keyrings/josm-apt.gpg] https://josm.openstreetmap.de/apt noble universe

在这种情况下,正确的文件是 /etc/apt/sources.list.d/josm.list

现在,在编辑器中打开此文件(以 root 身份!),例如

edit_josm_list.sh
sudo nano /etc/apt/sources.list.d/josm.list

文件将如下所示,有或没有 [] 部分

josm.list
deb [signed-by=/usr/local/share/keyrings/josm-apt.gpg] https://josm.openstreetmap.de/apt noble universe

现在,将 arch=amd64 添加到方括号 [] 中。如果方括号缺失,直接在 deb 之后添加:

josm.list.fixed
deb [arch=amd64 signed-by=/usr/local/share/keyrings/josm-apt.gpg] https://josm.openstreetmap.de/apt noble universe

顺序不重要,但 arch=amd64 必须在方括号内! 我们刚刚做的是告诉 APT 仅对此仓库使用 amd64 架构。

之后,保存文件(在 nano 中按 Ctrl+O)并退出编辑器(在 nano 中按 Ctrl+X)。

现在你可以再次运行 apt update,警告消息应该消失了 - 不过你可能需要对有相同警告的其他仓库重复此步骤。


Check out similar posts by category: Linux