2

I had and issue with WSL installing a package, so I decided to uninstall Ubuntu 22.04 to fresh install again. I did the mistake to delete manually some files and then I had some issues to reinstall Ubuntu, it displayed an error: there was no file in C:\Users\PC\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx.

Finally I was able to installed, and later I wanted to inspect the folder to see what is inside, and seems to be empty. Is that correct? Now my Ubuntu terminal runs correctly. I updated packages, open Python3 in the terminal open Visual Studio Code from WSL, but overall I have the feeling that something is wrong.

Another thing is that when I go to the Linux folder, there are two Ubuntu folders, and when I try to access Ubuntu 22.04 it does not allow me. Before I just had one Ubuntu in that location.

Ubuntu folder in Windows

1 Answers1

6

At this point, it seems that you have two "distributions" still "registered", as far as WSL understands. You can see the list of distributions with:

wsl.exe -l -v

I'm assuming that this list matches your screenshot:

  • Ubuntu
  • Ubuntu-22.04

Given that the package location for 22.04 is empty, I'm also assuming that this was the first one you installed and the one that you manually deleted.

I know it sounds like I'm repeating myself (and your question), and that's because the command to fix this is destructive and irreversible, so please make sure that you are removing the right one (if you have any files in the other that are important).

Assuming that Ubuntu works and Ubuntu-22.04 doesn't:

# Warning:  destructive operation
wsl --unregister Ubuntu-22.04

That should remove the registration for the one that you removed manually.

NotTheDr01ds
  • 22,082