20

I tried to install python-pip by typing this command:

sudo apt-get install python-pip

And the result is below:

Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main python2.6-minimal armhf 2.6.8-1.1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main python2.6 armhf 2.6.8-1.1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-pkg-resources all 0.6.24-1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-setuptools all 0.6.24-1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-pip all 1.1-3
  Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/python2.6/python2.6-minimal_2.6.8-1.1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/python2.6/python2.6_2.6.8-1.1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/d/distribute/python-pkg-resources_0.6.24-1_all.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/d/distribute/python-setuptools_0.6.24-1_all.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/python-pip/python-pip_1.1-3_all.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Then I tried to sudo apt-get update and sudo apt-get update --fix-missing, but it doesn't work either.

The result was like this:

Err http://raspberrypi.collabora.com wheezy Release.gpg
  Temporary failure resolving 'raspberrypi.collabora.com'
Err http://archive.raspberrypi.org wheezy Release.gpg
  Temporary failure resolving 'archive.raspberrypi.org'
Err http://mirrordirector.raspbian.org wheezy Release.gpg
  Temporary failure resolving 'mirrordirector.raspbian.org'
Reading package lists... Done
W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/wheezy/Release.gpg  Temporary failure resolving 'mirrordirector.raspbian.org'

W: Failed to fetch http://raspberrypi.collabora.com/dists/wheezy/Release.gpg  Temporary failure resolving 'raspberrypi.collabora.com'

W: Failed to fetch http://archive.raspberrypi.org/debian/dists/wheezy/Release.gpg  Temporary failure resolving 'archive.raspberrypi.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.

How can I solve this problem?

  • 6
    Have you checked that your internet connection is working correctly? – IntelligentHeating Aug 28 '13 at 14:31
  • 1
    problem is mirror. I can get everywhere else but there. Ping to it works, but forget about data. – user9378 Sep 5 '13 at 19:03
  • how many connection you have?? I have same problem when I have 2 ethernet connection eth0 and wlan0 – inye Apr 8 '14 at 22:08
  • I got this after I updated my distro from wheezy to jessie. Had to reconfigure my wifi. Try wget google.com to confirm the nature of this error – boulder_ruby Jan 1 '15 at 17:28
  • What's the content of /etc/network/interfaces? – wb9688 Oct 28 '15 at 12:20
16

It looks like you are having problems resolving the various URLs that apt-get is fetching from.

I would try the following:

1.) Check you have an active Internet connection, try google.com with a second machine for example. 2.) If your Raspberry Pi is attached to your home router, check it has an IP# assigned 3.) Try pinging google.com from the command line:

ping google.com

You should see something like:

PING google.com (74.125.226.233): 56 data bytes
64 bytes from 74.125.226.233: icmp_seq=0 ttl=56 time=3.281 ms
64 bytes from 74.125.226.233: icmp_seq=1 ttl=56 time=4.058 ms
64 bytes from 74.125.226.233: icmp_seq=2 ttl=56 time=3.999 ms

If this does not work then it could be either your Internet connection or a DNS issue.

For DNS issues check your resolv.conf file is configured correctly (if you have manually assigned nameservers):

/etc/resolv.conf

If you are using DHCP the resolv.conf should be updated automatically.

  • 1
    sorry to be late replying. the ping doesn't work. DNS was the same as the my pc: mac when I enter ping, they say: connect: Network is unreachable I also changed interfaces; dchp -> static so I added address, netmask, gateway. – SamuraiT Sep 19 '13 at 15:16
  • also,I tried other DNS -nameserver 8.8.8.8 nameserver 8.8.4.4 then I entered ping and they said ping: unknown host google.com – SamuraiT Sep 19 '13 at 15:22
  • even I tried to ping to gateway, it didn't work. so I assume there are some problems with gateway. However, when I pinged from Mac, It worked; the problem isn't gateway itself. – SamuraiT Sep 19 '13 at 15:32
  • 1
    How did you manage to solve this problem ? – user3378649 Feb 17 '15 at 18:44
3

Try

sudo apt-get update

followed by

sudo apt-get upgrade

and then retry installing the python-pip.

I fixed the exact same issue I was having a week ago.

  • 3
    OP clearly does not have internet connection working, your advice is nice, but from the different problem =) – lenik Aug 29 '13 at 10:55
  • @lenik Maybe, as he tries a bunch of URLs. But I was getting failed to fetch error and a 404 with mirrordirectory. And doing sudo apt-get update then doing sudo apt-get install nmap worked. Whereas prior to the update, I was getting the 404 fetch error on mirrordirectory. Googling the problem brought up this QnA page. – barlop Jun 18 '14 at 13:00
  • I had a similar problem with "sudo apt-get install dnsutils" (404's, though). This solved the problem. – Peter Mortensen Oct 27 '15 at 14:37
  • No, you had a totally different problem which you thought was similar due to not understanding the error messages. – Peter Green Oct 27 '15 at 17:50
1

I had the exact same problem, after an error made while setting fixed IP-addresses for my network adapters. sudo nano /etc/network/interfaces to edit, and make sure no two IP-adresses are the same for one adapter. I had broadcast and gateway on the same address, but that killed internet access.

Also, if you use Pi both with and without network cable, but always with wlan-adapter, you need to set netmask, network, broadcast and gateway for both adapters.

0

I have just found that mine wouldn't update while using my wifi adapter. I do have a fixed IP address on this so I'm not sure if it's because I'm using the wifi adapter or because I've got it fixed IP. Thought that might help some people as I found that when I reconnected my LAN cable and removed my USB Wifi adapter it worked fine.

0

I would recommend checking your Time & Date Settings on your Pi.

Having the wrong time or date affects downloading files hosted on a certificate.

To check, simply boot to desktop "startx", and click on the time on the toolbar. It will say the time and the date!

  • 1
    Or simply type "date" into the command line... – M.Herzkamp Feb 21 '17 at 21:31

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