如何修复 apt-get 更新期间出现的“无法获取 binary-armhf/Packages”错误?

如何修复 apt-get 更新期间出现的“无法获取 binary-armhf/Packages”错误?

当我运行时sudo apt-get update出现以下错误:

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.15 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

我尝试查看/etc/apt/sources.list.d/是否可以删除该目录中的任何内容,但其中只有

nodesource.list
nodesource.list.save

在我的sources.list档案中我有:

deb http://ports.ubuntu.com/ubuntu-ports/ trusty main
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main
deb http://archive.ubuntu.com/ubuntu trusty main
# deb-src http://archive.ubuntu.com/ubuntu trusty main

有人能推荐一种修复此错误的方法吗?

答案1

您可能安装了armhf添加为外部架构的交叉工具armhf(您的架构可能是 i386 或 amd64)。您可以启动此命令来验证:

dpkg --print-foreign-architectures

如果输出包含armhf,您可以通过运行以下命令将其删除:

sudo dpkg --remove-architecture armhf

最后,再次启动sudo apt-get update

答案2

有问题的行来自 x86 源列表。删除它可以消除错误。以下是 armf 架构的正确列表。

deb http://ports.ubuntu.com/ubuntu-ports/ trusty main
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main

相关内容