26

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?

Peter Mortensen
2,0042 gold badges15 silver badges18 bronze badges
asked Aug 28, 2013 at 14:02
7
  • 7
    Have you checked that your internet connection is working correctly? Commented Aug 28, 2013 at 14:31
  • 1
    problem is mirror. I can get everywhere else but there. Ping to it works, but forget about data. Commented Sep 5, 2013 at 19:03
  • 1
    how many connection you have?? I have same problem when I have 2 ethernet connection eth0 and wlan0 Commented Apr 8, 2014 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 Commented Jan 1, 2015 at 17:28
  • 1
    Thanks for the tips sudo apt-get update --fix-missing worked for me! Commented Jan 31, 2018 at 18:58

7 Answers 7

22

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.

answered Aug 28, 2013 at 14:48
5
  • 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. Commented Sep 19, 2013 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 Commented Sep 19, 2013 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. Commented Sep 19, 2013 at 15:32
  • 1
    How did you manage to solve this problem ? Commented Feb 17, 2015 at 18:44
  • perfect thanks @IntelligentHeating--worked for me. At first I was thinking it was a DNS issue! Commented Mar 29, 2021 at 14:50
6

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.

Peter Mortensen
2,0042 gold badges15 silver badges18 bronze badges
answered Aug 29, 2013 at 5:57
4
  • 3
    OP clearly does not have internet connection working, your advice is nice, but from the different problem =) Commented Aug 29, 2013 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. Commented Jun 18, 2014 at 13:00
  • I had a similar problem with "sudo apt-get install dnsutils" (404's, though). This solved the problem. Commented Oct 27, 2015 at 14:37
  • No, you had a totally different problem which you thought was similar due to not understanding the error messages. Commented Oct 27, 2015 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.

answered Jan 3, 2014 at 12:37
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.

answered Feb 20, 2014 at 22:27
1
  • This is a comment, not an answer: You haven't provided anything that looks like a solution. Commented Oct 26, 2023 at 2:39
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!

answered Oct 28, 2015 at 8:23
2
  • 4
    Or simply type "date" into the command line... Commented Feb 21, 2017 at 21:31
  • @M.Herzkamp Indeed, "startx" would do nothing for me :) Commented May 25, 2020 at 18:03
0

It's now March, 2020. And I'm getting the problems described above.
Several in times in the past few months, I have been able to upgrade my PIs' Raspian without problem.
But I noticed yesterday that my fileserver's clock was off by 10 min or so, even though the Raspberry had been rebooted several times in the past few months.
So I tried installing nptdate: sudo apt-get install ntpdate.
NO GO.
So I tried doing an update: apt-get update (just like did a long time ago with "stretch").
NO GO. All I get is the following:
Err:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease Temporary failure resolving 'raspbian.raspberrypi.org'
Err:2 http://mirrordirector.raspbian.org/raspbian buster InRelease Temporary failure resolving 'mirrordirector.raspbian.org'
Err:3 http://archive.raspberrypi.org/debian stretch InRelease Temporary failure resolving 'archive.raspberrypi.org'

When are the Raspbian's update servers ever available? I used to have this on Stretch a couple of years ago, and now it's happening again!

answered Mar 19, 2020 at 6:49
1
  • This is a comment, not an answer: You haven't provided anything that looks like a solution. Commented Oct 26, 2023 at 2:42
0

That's normal, it's because python-pip hasn't a version that can be installed. You must write

sudo apt-get install python3-pip -y

answered Feb 14, 2023 at 15:09
1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented Feb 15, 2023 at 10:55

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.