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,004
  • 2
  • 15
  • 18
SamuraiT
  • 369
  • 1
  • 3
  • 4

7 Answers7

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.

  • 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
  • perfect thanks @IntelligentHeating--worked for me. At first I was thinking it was a DNS issue! – gdgr Mar 29 '21 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,004
  • 2
  • 15
  • 18
Paul
  • 87
  • 1
  • 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.

RolfBly
  • 619
  • 1
  • 9
  • 23
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!

aqk
  • 179
  • 1
  • 9
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

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

  • 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. – Community Feb 15 '23 at 10:55
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!

Praveen K
  • 81
  • 5