Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo apt-get update fails #3669

Closed
OrangeBacon opened this issue Nov 16, 2018 · 21 comments
Closed

sudo apt-get update fails #3669

OrangeBacon opened this issue Nov 16, 2018 · 21 comments

Comments

@OrangeBacon
Copy link

  • 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
@sirredbeard
Copy link
Contributor

Are you using a third-party antivirus, firewall, proxy, or VPN by chance? See #3647.

@OrangeBacon
Copy link
Author

I am using kasperskey, I will try killing it fully rather than just disabling it, when I'm back at my pc, thanks I hadn't seen that issue when searching for the problem

@therealkenc
Copy link
Collaborator

I hadn't seen that issue when searching for the problem

FAQ

@bladeoner
Copy link

bladeoner commented Nov 17, 2018

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/

@OrangeBacon
Copy link
Author

Thanks, what has been said here is correct for me, it would be great if kasperskey could fix the issue.

@coralnode
Copy link

Closing Kasperkey fixed it for me as well.

@AdamJHowell
Copy link

Symantec Endpoint Protection also causes this problem. Temporarily disabling Symantec seems to allow apt-get in WSL Ubuntu to function properly.

@ghost
Copy link

ghost commented Jul 31, 2019

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

@537mfb
Copy link

537mfb commented Jun 14, 2020

AVAST Also causes this problem. Temporarilly disabling AVAST allows apt-get to work

@hritik5102
Copy link

hritik5102 commented Jan 3, 2021

Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
  Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused)
Err:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Unable to connect to archive.ubuntu.com:http:
Err:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Unable to connect to archive.ubuntu.com:http:
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Could not connect to security.ubuntu.com:80 (2001:67c:1562::18). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1562::15). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.39). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.38). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not connect to security.ubuntu.com:80 (2001:67c:1562::18). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1562::15). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.39). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.38). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Got the same issue while doing sudo apt-get update , I don't have any kind of antivirus running behind the scene, I don't know might be because of a windows update, I really don't know, how to fix it? please help

@537mfb
Copy link

537mfb commented Jan 3, 2021

@hritik5102 your error is diferent - claims you don't have the correct permissions

Are you using the command apt-get update or sudo apt-get update?
If you are using the first one, use with the second one, otherwise make sure you don't have a VPN or Proxy that may be affecting it

Also try going to http://archive.ubuntu.com/ubuntu in your browser of choice and see if it reports any error

@hritik5102
Copy link

hritik5102 commented Jan 3, 2021

Hello @537mfb, I'm using sudo apt-get update (2nd command) and also I open the Ubuntu terminal as administrator and tried to open this http://archive.ubuntu.com/ubuntu but it is not opening in my browser.

Tried this

hritik@DESKTOP-6O5AD1H:/mnt/d/Github-Projects$ ping archive.ubuntu.com
PING archive.ubuntu.com (91.189.88.161) 56(84) bytes of data. 

No packet transmitted and not received

@537mfb
Copy link

537mfb commented Jan 3, 2021

@hritik5102 if that address doesn't open in your browser (Windows) you have something else blocking your access to the internet

Can be some antivirus, VPN, Proxy or something else - I don't know what you have on your PC/network to be able to tell

Are there any other PCs/devices on your network? like a smartphone or tablet? if so, try to access that address on their browsers - if other devices can reach it than the problem is in your PC - otherwise the problem is in your network

On my PC i get

$ ping archive.ubuntu.com
PING archive.ubuntu.com (91.189.88.142) 56(84) bytes of data.
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=1 ttl=55 time=35.3 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=2 ttl=55 time=34.5 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=3 ttl=55 time=35.4 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=4 ttl=55 time=34.7 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=5 ttl=55 time=37.4 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=6 ttl=55 time=35.5 ms
^C
--- archive.ubuntu.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 34.527/35.496/37.439/0.941 ms

@hritik5102
Copy link

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 protection after I turned off and ran this command sudo apt-get install it worked for me.

and then I restarted my laptop, the real time protection turned on automatically. Thanks a lot @537mfb for helping me out :)

@537mfb
Copy link

537mfb commented Jan 4, 2021

Glad i could help @hritik5102 - not sure why defender would block complete access to Ubuntu arquive even um browser and ping but am glad it is solved

Btw my Avast no longer blocks it so a future update of defender may fix this

@tensor-programming
Copy link

tensor-programming commented Jan 4, 2021

I am also seeing the same issues with windows defender. It seems that something about it is blocking apt completely from getting the repositories. On build 19042. Seems to work fine if I add an exclusion to defender on the process for WSL.

@jmervine
Copy link

FWIW, and this may have been said, but a simple sudo apt-get update fixed this for me.

@537mfb
Copy link

537mfb commented Jan 24, 2021

FWIW, and this may have been said, but a simple sudo apt-get update fixed this for me.

sudo apt-get update fixed an error calling sudo apt-get update? Is it just me or that makes no sense?

@moealiwork
Copy link

Disabling the antivirus worked for me!

@gkjoyes
Copy link

gkjoyes commented Jun 27, 2021

After changing the DNS server, It's working fine for me.

@Lmaxplay
Copy link

Lmaxplay commented Mar 1, 2022

Can confirm on avast one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests