2

I'm getting a strange problem on my raspberry pi. I tried to install a program today using apt-get and I got this output:

Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libcurl3 armhf 7.26.0-1+wheezy13
  Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main curl armhf 7.26.0-1+wheezy13
  Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/c/curl/libcurl3_7.26.0-1+wheezy13_armhf.deb  Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/c/curl/curl_7.26.0-1+wheezy13_armhf.deb  Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The strange this is using ping to reach either the dns host or the ip works fine and I get normal responses.

The same thing applies if I want to get the content of google.com using wget, it remains stuck at

Resolving google.com (google.com)... 149.3.177.90, 149.3.177.86, 149.3.177.85, ...
Connecting to google.com (google.com)|149.3.177.90|:80...

forever but pinging works. How can I fix this?

The content of resolv.conf:

nameserver 192.168.1.1
nameserver 8.8.8.8
7
  • You connecting to something else and pingin something else. Try pinging the server.... to which you cannot connect to... also form your main machine. Pinging google wont let you know if 2001:41c9:1:3ce::11 is down. Also make sure your IPV6 is working properly or try IPV4
    – Piotr Kula
    Aug 14, 2015 at 9:04
  • How can I make sure ipv6 is working properly?
    – qwertz
    Aug 14, 2015 at 9:04
  • 2
    :) Good question! For another site. By the looks of your ping to Google, you only have IPv4... otherwise Googley Box would also reply in IPv6 - So I would say the mirrorredirector is doing something dodgy, you have some wierd apt cache issue maybe, try clear that, turn off IPv6 on your MODEM/ROUTER and in Raspbian Conf
    – Piotr Kula
    Aug 14, 2015 at 9:06
  • But the problem not only applied to apt-get so I would assume that works fine? Also my router doesn't support ipv6 so I disabled it by using some commands I found online. Could that be the problem?
    – qwertz
    Aug 14, 2015 at 9:07
  • 2
    POssibly... just look at the error message. (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80] <-- that is IPv6 Why is it there? Something must have enabled or cahced IPv6 addresses. Ping Google and you have 149.3.177.90 which tells me that you have NO IPv6, just as you said too.. so why is apt trying to connect to IPv6? :) You see. Off the top of my head I dont know my self, otherwise i would anser
    – Piotr Kula
    Aug 14, 2015 at 9:09

2 Answers 2

2

this looks very familiar. I work with a large variety of linux machines which run at more than 100 service providers, so it happens from time to time, that their network is to some degree broken, especially if IPv6 is involved. You see that immediately when using apt-get update -- the domains would resolve to a IPv6 and freeze right there. All IPv4 traffic was working fine.

for my purpose, I just need IPv4, so I disable IPv6 on all machines during installation like this:

# sometimes IPv6 creates problems, the DNS would resolve to a IPv6 and
# curl/apt-get will freeze for unknown reasons
echo "disabling IPv6 on the node... sorry!"
echo "" >> /etc/sysctl.conf
echo "# to disable IPv6 on all interfaces system wide" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf 

run this as root. you might need to reboot the machine after this.

0

Might be a problem with a local proxy, if you have one do the following: [I did this in the last release, i haven't tried it since!]

nano ../etc/apt/apt.conf.d/10proxy

will create the file "10proxy" in which you write:

Acquire::http:Proxy “http:/username:[email protected]:9999“;

"username" and "password" don't have to be replaced, the 9's are to be replaced with the IP of the proxy and the port of it. If you don't know these ask your admin, he might be able to help.

On a sidenote: Downloading using apt-get over a proxy (that sometimes includes a virus scanner) might just kill large downloads, it's better to get a direct internet connection.

2
  • As far as I know I am not using a proxy, I am judt connected to the mobile router my internet provider gave me
    – qwertz
    Aug 14, 2015 at 9:00
  • This is not a proxy issuee
    – Piotr Kula
    Aug 14, 2015 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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