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
qwertz
  • 180
  • 2
  • 10

2 Answers2

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.

Eugen
  • 488
  • 3
  • 13
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:password@999.99.999.999: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.

Cupacoffee
  • 97
  • 2