Why apt-get update fail to connecting to dl.google.com?
My Ubuntu is 14.04.
I try to update my packages by:
sudo apt-get updateThen it stuck at
100% [Connecting to dl.google.com (203.208.40.46)]for several minutes. It is quite annoying.
I try to set a timeout for the connections How to lower wait time for repository updates.
After several seconds, it failed and end the process.
Err stable InRelease
Err stable Release.gpg Cannot initiate the connection to dl.google.com:80 (2401:3800:4002:802::1005). - connect (101: Network is unreachable) [IP: 2401:3800:4002:802::1005 80]
Reading package lists... Done
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch Unable to connect to build.openvpn.net:http:
W: Failed to fetch 404 Not Found
W: Failed to fetch 404 Not Found
W: Failed to fetch Cannot initiate the connection to dl.google.com:80 (2401:3800:4002:802::1005). - connect (101: Network is unreachable) [IP: 2401:3800:4002:802::1005 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.My location is China. I have Shadowsocks SOCKS5 system proxy and OpenVPN connecting to the same VPS server. I have tried turning off them both separately and together, but it did not work.
I wonder why this happen and how do I tackle it?
---update---
I could download the provided by @JonasCz.
13 Answers
When I have this problem, I disable IPv6 in Ubuntu and that fix the problem, in order to do that, please follow these steps:
To disable IPv6, you have to open /etc/sysctl.conf using any text editor and add the following lines at the end:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1If IPv6 is still enabled, then the problem is that sysctl.conf is still not activated.
In that case, open a terminal(Ctrl+Alt+T) and type the command:
sudo sysctl -pThe output will be very similar to these 3 lines:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1After that, execute:
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6If you see 1 in the output, then IPv6 has been successfully disabled.
1Hope this helps.
5Have just found another option that only worked for me: after I updated Google's GPG key in my Ubuntu 18.04
curl | sudo apt-key add -software update went well:
sudo apt update I had a similar issue with the Google Chrome apt repository, and I resolved it with updating the repository key:
wget -q -O - | sudo apt-key add -as stated at google official site: