24

I can't connect to mirrordirector.raspbian.org in Raspbian, but I don't know why.

I've already re-installed Raspbian, but it looks like this is not the problem. How can I resolve this?

After I connected to my Raspberry Pi over SSH from another computer and then run sudo apt-get update and work like a charm. But, if someone can explain why it wasn't working when I was executing the command from the Pi itself, it would be great!

Aurora0001
  • 6,357
  • 3
  • 25
  • 39
William Bello
  • 343
  • 1
  • 2
  • 6

7 Answers7

28

This Answer is obsolete. The operation of mirrordirector has changed.

Using terminal or your favorite text editor you can define a specific mirror to use in

 /etc/apt/sources.list

Just comment out the line

 deb http://mirrordirector.raspbian.org/raspbian wheezy main firmware

So it looks like this

 #deb http://mirrordirector.raspbian.org/raspbian wheezy main firmware

And replace with a mirror close to you from list below

The list of mirrors can be found here

I (being in the US) use the lease Web mirror

Update

Problem seems dns related (except for slow ping when you used actual ip of Google.

Update your /etc/network/interfaces eth0 line to include (or update existing) to be (as last line of section)

 dns-nameservers 8.8.8.8 8.8.4.4

Those are Google name servers. Just to see if get better performance. If you would like less prying eyes than Google, there are other free providers out there.

As far as slow ping when pinged ip address of Google, I would reboot router and/or modem.

Update 2

If adding to /etc/network/interfaces didn't work add the following as last line of /etc/resolv.conf

 nameserver 8.8.8.8 8.8.4.4

And then restart or just restart networking

Edit 3 Also if you could update answer with output of

 ifconfig

You do this via terminal. It will show us the local address of the Pi. Also, please update answer with local ip of computer that is working, or the local address of the router. For example mine is

 192.168.1.1
Milliways
  • 62,573
  • 32
  • 113
  • 225
geoffmcc
  • 621
  • 5
  • 8
8

I suffered similar issue, and use this way to sovle it. First, comment out this in /etc/apt/sources.list:

#deb http://mirrordirector.raspbian.org/raspbian jessie main contrib non-free
deb http://apt.osmc.tv jessie main

then do sudo apt-get update and sudo apt-get upgrade. Then recover the sources.list

deb http://mirrordirector.raspbian.org/raspbian wheezy main firmware
deb http://apt.osmc.tv jessie main

Do sudo apt-get update and sudo apt-get upgrade again. It no longer happen.

Gord Chen
  • 81
  • 1
  • 1
4

My solution was to disable IPv6 in the router.

4

One way is to add following lines to /etc/hosts file

  1. Open /etc/hosts file with sudo rights $sudo nano /etc/hosts
  2. Paste the following lines at the end of /etc/hosts file

    93.93.128.193   mirrordirector.raspbian.org
    

    93.93.128.191 archive.raspbian.org

This works for me!!

Tanuj
  • 246
  • 2
  • 4
3

In my case (same behavior, no name server resolution) I fixed it by modifying the /etc/nsswitch.conf it only had files and dns was disabled. Now the hosts line is: hosts: files dns

1

I tried everything that geoffmcc provided but it still did not work for me. My solution was to change the DNS servers on my router. I used the OpenDNS name servers. enter image description here

I would imagine you can use the google name servers also as mentioned above. I would think that adding it to the resolve.conf or the interfaces file would work for some reason it didn't in my case. Hopefully this might help someone else.

villaa19
  • 111
  • 2
0

I tested my IPv6 connection using this site http://ipv6-test.com/ It said my IPv6 wasn't working. I found on a forum post that someone rebooted their router and it was fixed. I rebooted my router and the problem was fixed. The person who said to reboot the router had persistent problems had had to occasionally reboot the router. Also, the IPv6 test fails at my job. My job is at a company so big that the internet goes out of a different part of the country. Disabling IPv6 on your pi might work, but I think it's better to just fix IPv6 at the router level.

Russell Hankins
  • 201
  • 2
  • 7