WSL: ./usr/bin/python3: Hard-link target './usr/bin/python' does not exist. while converting Ubuntu form WSL1 to 2

Windows build number: Microsoft Windows [Version 10.0.19582.1001]

Linux distro : Ubuntu 18.04 LTS

What i was doing: Start using wsl2 for ubuntu 18.04 LTS following the documentation.

What’s wrong: in the step wsl --set-version Ubuntu 2 i got the following output

Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Importing the distribution failed.
./usr/bin/python3: Hard-link target './usr/bin/python' does not exist.
bsdtar: Error exit delayed from previous errors.

however in Ubuntu i run which python and the file is already there and linked to python3

> which python
/usr/bin/python
> whereis python
python: /usr/bin/python /usr/bin/python3.6 /usr/bin/python3.6m /usr/lib/python2.7 /usr/lib/python3.6 /usr/lib/python3.7 /usr/lib/python3.8 /etc/python3.6 /usr/local/lib/python3.6 /usr/share/python /mnt/c/Users/A/AppData/Local/Microsoft/WindowsApps/python.exe /mnt/c/Users/A/AppData/Local/Microsoft/WindowsApps/python3.exe

logs: (if needed) https://1drv.ms/u/s!AjOByjqmdzjMgg6ue9Ms-QvdJDKv?e=jjWjf8https://1drv.ms/u/s!AjOByjqmdzjMgg6ue9Ms-QvdJDKv?e=jjWjf8.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 15 (1 by maintainers)

Most upvoted comments

I deleted the python3 file in my /usr/bin folder since it was only a link to python3.8 - then the installation worked

If anyone sees this then note that I had to re-link by calling

sudo ln /usr/bin/python3.8 /usr/bin/python3

afterwards - otherwise I had problems using apt

That is strange but because you opened an issue if it happens to other uses we will be able to track it. Thank you.

Well something weird just happened, i was bored I’ve just decided “Why no to run the wsl --set-version Ubuntu 2 as admin again for no reason” then

Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.

I don’t know what happened but when i tried it for the second time on the same shell but it worked

Capture4