16.04 升级:无法获取空文件,不能是有效的档案

16.04 升级:无法获取空文件,不能是有效的档案

从 15.10 升级到 16.04 后,我收到以下错误apt-get update

Reading package lists... Done
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/source/Sources  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/source/Sources  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/source/Sources  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-amd64/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-i386/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/i18n/Translation-en  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-amd64/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-i386/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/i18n/Translation-en  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-amd64/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-i386/Packages  Empty files can't be valid archives
E: Some index files failed to download. They have been ignored, or old ones used instead.

有人知道如何解决这个错误吗?

答案1

转到“Ubuntu 软件中心->编辑->软件源”,
从“下载自”中选择“其他...”,然后单击“选择最佳服务器”。这将需要一些时间...然后它会为您找到最佳服务器。然后选择该服务器并再次输入以下命令,

sudo apt-get update

答案2

升级后的过去几个月我一直遇到此问题,但只是运行:

apt-get clean

已修复。无需像其他人建议的那样更改源服务器。

答案3

apt-get clean

与我合作过:

apt-key update

并按照此答案中的步骤操作:

无法解决 GPG 错误

答案4

我在不同的档案中也遇到过这种情况。查找并删除 0 字节文件后,/var/lib/apt/lists问题就解决了。

相关内容