WSL 中的 apt update 失败:无法获取...没有此文件或目录

WSL 中的 apt update 失败:无法获取...没有此文件或目录

我已经更新了 WSL 本身(以管理员身份)

> wsl --set-version ubuntu-20.04 2
> wsl --update

它有效但仍然不能解决我在 WSL Ubuntu 20.04 中的问题。

$ sudo apt update
Reading package lists... Error!
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_main_binary-amd64_Packages.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_main_binary-amd64_Packages -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_main_binary-amd64_Packages).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_main_i18n_Translation-en.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_main_i18n_Translation-en -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_main_i18n_Translation-en).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_main_cnf_Commands-amd64.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_main_cnf_Commands-amd64 -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_main_cnf_Commands-amd64).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_restricted_binary-amd64_Packages.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_restricted_binary-amd64_Packages -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_restricted_binary-amd64_Packages).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_restricted_i18n_Translation-en.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_restricted_i18n_Translation-en -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_restricted_i18n_Translation-en).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_restricted_cnf_Commands-amd64.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_restricted_cnf_Commands-amd64 -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_restricted_cnf_Commands-amd64).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_universe_binary-amd64_Packages.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_universe_binary-amd64_Packages -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_universe_binary-amd64_Packages).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_universe_i18n_Translation-en.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_universe_i18n_Translation-en -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_universe_i18n_Translation-en).
E: Failed to fetch store:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_universe_cnf_Commands-amd64.xz  rename failed, No such file or directory (/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_universe_cnf_Commands-amd64 -> /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_universe_cnf_Commands-amd64).
...
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Problem renaming the file /var/cache/apt/srcpkgcache.bin.OL2UsH to /var/cache/apt/srcpkgcache.bin - rename (22: Invalid argument)
E: Problem renaming the file /var/cache/apt/pkgcache.bin.EdYnXG to /var/cache/apt/pkgcache.bin - rename (22: Invalid argument)
W: You may want to run apt-get update to correct these problems
E: The package cache file is corrupted

sudo rm -rf /var/lib/apt/lists/*sudo apt clean没什么帮助。以下是我的资料来源,全部来自/etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ focal main restricted
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ focal universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
deb http://archive.ubuntu.com/ubuntu/ focal multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb http://archive.canonical.com/ubuntu focal partner
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
deb http://security.ubuntu.com/ubuntu/ focal-security universe
deb http://security.ubuntu.com/ubuntu/ focal-security multiverse

我不知道这是否与 WSL 相关或与 Ubuntu 相关,但我猜是前者,因为我在原生 Ubuntu 上从未遇到过这样的问题。

我主要将 WSL 用作 SSH 和 Git 客户端。

有人知道这里出了什么问题吗?

答案1

如果你使用Acrons 真实形象. 感谢@jannes-bottis

按 Strg-Shift-Esc

转到“进程”选项卡,按名称排序并查找 Acronis Drive 进程。杀了它。

此后,更新有效。

@Acronis 请修复!

https://forum.acronis.com/forum/acronis-true-image-2017-forum/acronisdriveexe-causes-issues-windows-10-subsystem-linux-bash

相关内容