WSL: sudo apt-get update fails
-
Windows version: Microsoft Windows [Version 10.0.17134.345]
-
What you’re doing and what’s happening: (Copy&paste specific commands and their output, or include screen shots)
sudo apt-get update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Connection failed [IP: 91.189.88.162 80]
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Connection failed [IP: 91.189.88.161 80]
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Connection failed [IP: 91.189.88.162 80]
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Connection failed [IP: 91.189.88.161 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Connection failed [IP: 91.189.88.161 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Connection failed [IP: 91.189.88.162 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Connection failed [IP: 91.189.88.161 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Connection failed [IP: 91.189.88.162 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
ping google.com
PING google.com (172.217.23.14) 56(84) bytes of data.
64 bytes from lhr35s01-in-f14.1e100.net (172.217.23.14): icmp_seq=1 ttl=50 time=7.60 ms
64 bytes from lhr35s01-in-f14.1e100.net (172.217.23.14): icmp_seq=2 ttl=50 time=7.86 ms
64 bytes from lhr35s01-in-f14.1e100.net (172.217.23.14): icmp_seq=3 ttl=50 time=7.10 ms
64 bytes from lhr35s01-in-f14.1e100.net (172.217.23.14): icmp_seq=4 ttl=50 time=7.13 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
-
What’s wrong / what should be happening instead: wsl cannot connect to the server, but it can connect to the internet. Trying to run wsl as administrator did not change the issue, neither did turning off my firewall.
-
Strace of the failing command: https://gist.github.com/ScratchOs/1308fdb39a9e57b7b5440f3ee5f844be
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 8
- Comments: 21
Are you using a third-party antivirus, firewall, proxy, or VPN by chance? See #3647.
Symantec Endpoint Protection also causes this problem. Temporarily disabling Symantec seems to allow apt-get in WSL Ubuntu to function properly.
I can confirm that this also is on Windows 10 build 1809, this is a issue on Kaspersky’s side. I also use Windows 10 with the Linux Subsystem and Kaspersky.
There are more people having the same issue: https://forum.kaspersky.com/index.php?/topic/395813-bash-windows-10-wsl-connection-issues/
FWIW, I had these problems but it turns out my corporate proxy doesn’t support https.
The fix was to edit the “/etc/apt/apt.conf” file. See Windows 10 WSL Ubuntu 18.04 proxy configuration for apt blog article
AVAST Also causes this problem. Temporarilly disabling AVAST allows apt-get to work
Disabling the antivirus worked for me!
Closing Kasperkey fixed it for me as well.
Oh god, it worked, I just turned off “windows defender” from
Start > Windows defender setting > virus and threat protection > virus and threat protection setting > real-time protectionafter I turned off and ran this commandsudo apt-get installit worked for me.and then I restarted my laptop, the real time protection turned on automatically. Thanks a lot @537mfb for helping me out 😃