4

My Ubuntu is 14.04.

I try to update my packages by:

sudo apt-get update

Then 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 http://dl.google.com stable InRelease                               

Err http://dl.google.com 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 http://dl.google.com/linux/chrome/deb/dists/stable/InRelease  

W: Failed to fetch http://build.openvpn.net/debian/openvpn/stable/dists/trusty/InRelease  

W: Failed to fetch http://build.openvpn.net/debian/openvpn/stable/dists/trusty/Release.gpg  Unable to connect to build.openvpn.net:http:

W: Failed to fetch http://ppa.launchpad.net/neovim-ppa/stable/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/neovim-ppa/stable/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found

W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/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]

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.

1

3 Answers 3

8

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 = 1

If 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 -p

The 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 = 1

After that, execute:

$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6

If you see 1 in the output, then IPv6 has been successfully disabled.

1

Hope this helps.

6
  • This fixed my similar issue perfectly. Mine is Ubuntu 16.04.3 LTS. Jan 8, 2018 at 4:58
  • Nice! Good to hear that. =D
    – galoget
    Jan 8, 2018 at 5:01
  • Glad to know it worked for you @SiqingYu
    – galoget
    Jan 12, 2018 at 14:19
  • @galoget Hey guy, I found that disabling IPv6 slows down my apt download speed, so I enabled it again. Is there any workaround? Jan 14, 2018 at 8:11
  • @SiqingYu, I always used the solution posted here, you can try this Using IPv4 or IPv6 for apt, hope this works.
    – galoget
    Jan 14, 2018 at 19:11
0

Have just found another option that only worked for me: after I updated Google's GPG key in my Ubuntu 18.04

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

software update went well:

sudo apt update 
0

I had a similar issue with the Google Chrome apt repository, and I resolved it with updating the repository key:

wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

as stated at google official site: https://www.google.com/linuxrepositories/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.