解决 apt 错误为 Could not open file(Permission denied) 的更新失败

错误信息看起来就是这样:

Reading package lists… Done
E: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/xenial/main/dep11/Components-amd64.yml
Could not open file /var/lib/apt/lists/partial/au.archive.ubuntu.com_ubuntu_dists_xenial_main_dep11_Components-amd64.yml.gz – open (13: Permission denied) [IP: 202.158.214.106 80]
E: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/dep11/icons-64×64.tar Could not open file /var/lib/apt/lists/partial/au.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_dep11_icons-64×64.tar.gz – open (13: Permission denied) [IP: 202.158.214.106 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

原因一般为之前某次更新中断,有的文件处于下载了一部分的状态。解决办法很简单,rm /var/lib/apt/lists/partial/* 即可,注意需要 root 权限。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注