Ubuntu – Reinstallation of Ubuntu WSL 18.04 and Python3-pip installation issues

aptpythonpython3software installation

I deleted and reinstalled Ubuntu by following the instructions here but the same issues with pip installation persisted even after I've reinstalled Ubuntu. I suspect that the re-installation process did not totally help me remove Ubuntu.

Just to be clear that the Ubuntu I am installing is a bash shell and not a disk image that requires partitioning – just downloading a copy of Ubuntu from Windows Store would do in my case

How can I cleanly remove all of Ubuntu bash files on (Windows 10 Version 10.0.17763 Build 17763)?

The steps I took to reinstall are:

  1. Uninstall Ubuntu under programs and features
  2. Deselect Windows Subsystem of Linux from apps & features
  3. Restart on clean reboot (as prompted by windows)
  4. Reinstall Ubuntu on Windows Store
  5. Setup
  6. Run sudo apt-get update
  7. Run pip installation

I've seen other methods of uninstalling such as wslconfig.exe /u Ubuntu, but I did the aforementioned way because of the Fall Creators update which allows this method. I'm not sure what's the difference between them and if it will make a difference in my case.

However, the same pip issues persisted, does this way of reinstalling guarantee that I get a fresh copy of python environment? What have I possibly done wrong?

The reason why I wanted to reinstall Ubuntu is because my pip is not functioning properly on only Ubuntu and not on Windows OS. The example is as follows:

Any advise will be greatly appreciated. Thank you!

Further details about what other stuff I have tried to troubleshoot the pip installation


Some recommended to use --no-cache-dir but it did not work and I even tried rm -rf ./cache/pip but that also did not work. So I reinstalled Ubuntu WSL, hoping that it will work but it didn't.


ping pypi.org does not work and returns the following message and freezes
PING pypi.python.org(2a04:4e42:2::223 (2a04:4e42:2::223)) 56 data bytes

What I have done about this issue:

1.Tried disabling IPv6 as recommended by @Kulfy here

Got the following error:

sysctl: cannot stat /proc/sys/net/ipv6/conf/all/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/default/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/lo/disable_ipv6: No such file or directory

2.Copied and pasted the following into Ubuntu:
Tried with sudo and root with the command below


cat >/etc/modprobe.d/blacklist-ipv6.conf <<EOF
# Turn of IPv6 by blacklisting the module.
# Even though it isn't needed.
blacklist ipv6


It returned the following -bash: /etc/modprobe.d/blacklist-ipv6.conf: Permission denied

as recommended here but also did not work

  1. Setting Preferences for IPv4 over IPv6

I have also set preferences for IPv4 by uncommenting these codes
and editing the file by doing

sudo vi /etc/gai.conf

and then… uncommenting

#For sites which prefer IPv4 connections change the last line to
precedence ::ffff:0:0/96 100
#    For sites which use site-local IPv4 addresses behind NAT there is
#    the problem that even if IPv4 addresses are preferred they do not
#    have the same scope and are therefore not sorted first.  To change
#    this use only these rules:
scopev4 ::ffff:  2
scopev4 ::ffff:    2
scopev4 ::ffff:       14

This is as recommended

This still has not worked. So, it may not be an issue with IPv6

Best Answer

What to check after reinstallation

In my case, I realised that even after re-installation, the issues persist. However, I realised that Hamachi's LogMeIn client was not in offline mode, which caused its Ethernet connection to interfere with Ubuntu's internet connection (but not on Windows OS). This is why when I pinged google.com it returned PING google.com(2404:6800:4003:c03::8a (2404:6800:4003:c03::8a)) 56 data bytes and stopped. The steps that @Kulfy took to help troubleshoot pointed me in the right direction, which made me realise that there was an additional Ethernet connection running.

In the future, if anyone still faces issue with their internet connection, even after reinstalling, please check that you do not have any antivirus software or other servers running at the same time, which may interfere with your Ubuntu's internet connection.

Go to Control Panel→Network and Internet→Network Connections on Windows to check whether you have additional servers running. Disable them (if found) and retry.

enter image description here