我正在尝试做
sudo apt-get update
但我收到以下错误:
W: Failed to fetch http://ftp.udc.es/ubuntu/dists/trusty/Release Unable to find expected entry 'main/binary-x8-64/Packages' in Release file (Wrong sources.list entry or malformed file)
我尝试按照这里的建议重置 /etc/apt/sources.list:
并且还尝试选择另一台服务器来下载更新:Ubuntu 12.04 上出现‘sudo apt-get update’错误
但我一直收到相同的错误信息。有什么想法吗?
正如评论中所要求的,这样做:
$ grep -R ftp.udc.es /etc/apt/sources.list*
/etc/apt/sources.list:deb http://ftp.udc.es/ubuntu/ trusty main universe
/etc/apt/sources.list.save:deb http://ftp.udc.es/ubuntu/ trusty main
$ cat sources.list
## See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
deb http://ftp.udc.es/ubuntu/ trusty main universe
# CDROMs are managed through the apt-cdrom tool.
$ dpkg --print-architecture
amd64
$ dpkg --print-foreign-architectures
i386
x8664
x8-64
x864
答案1
从 的输出可以看出dpkg --print-foreign-architectures
,由于某种原因,您添加了一堆无效的架构。删除它们:
sudo dpkg --remove-architecture x8664
sudo dpkg --remove-architecture x8-64
sudo dpkg --remove-architecture x864
将来,请检查您添加的内容。
答案2
尝试将这些添加到您的/etc/apt/sources.list
。这些是美国存储库。
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner
您可能会收到错误,因为 Canonical 已弃用 14.04(在 LTS 之前)。如果您没有使用 LTS,那么您应该升级到 14.04.01 LTS。
你可以通过运行来做到这一点sudo do-release-upgrade
答案3
去软件和更新,并且在Ubuntu 软件选项卡,将下载位置更改为选择最佳服务器。它将更新缓存,然后您就完成了。然后尝试apt-get update
。