Score:0

apt update in WSL fails: Failed to fetch ... no such file or directory

br flag

I already updated WSL itself (as Administrator)

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

Which worked but still did not solve my problem inside the 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/* and sudo apt clean did not help, too. Here are my sources, all from /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

I don't know if this is WSL related or Ubuntu related, but I guess the first as I never had such problems on native Ubuntu.

I use WSL mostly as SSH and Git client.

Anybody knows whats wrong here?

Nmath avatar
ng flag
Try `sudo apt clean` and then `sudo apt update` again. If that doesn't work, please edit your question with the output of `cat /etc/apt/sources.list`. Please also post the contents of any other `.list` files in `/etc/apt` or subdirectories
Jannes Botis avatar
in flag
Do you use Acronis software: https://forum.acronis.com/forum/acronis-true-image-2017-forum/acronisdriveexe-causes-issues-windows-10-subsystem-linux-bash ?
br flag
YES!!!! Thanks a lot!
Score:0
br flag

Here is the solution if you use Acrons True Image. Thanks to @jannes-bottis

Press Strg-Shift-Esc

Go to Processes tab, order by name and look for Acronis Drive process. KILL IT.

After that, update works.

@Acronis please fix!

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.