lbyrnes86
Posts: 10
Joined: Tue Apr 05, 2016 12:50 am

running sudo apt-get update not working

Wed Apr 20, 2016 4:49 pm

I recently installed raspbian jessie to my raspberry pi 2 and I can not get it to update or do anything else. I used the same SD card on an older raspberry pi model B and it worked fine. I attached a screen shot of the message I receive. I am wondering if there is an issue with the raspberry pi itself not the software.
Attachments
errorrasppi.jpg
errorrasppi.jpg (57.59 KiB) Viewed 1811 times
err.jpg
err.jpg (35.15 KiB) Viewed 1870 times
Last edited by lbyrnes86 on Wed Apr 20, 2016 5:01 pm, edited 1 time in total.

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: running sudo apt-get update not working

Wed Apr 20, 2016 4:53 pm

Image text not legible?
DNPNWO

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: running sudo apt-get update not working

Wed Apr 20, 2016 4:53 pm

lbyrnes86 wrote:I recently installed raspbian jessie to my raspberry pi 2 and I can not get it to update or do anything else. I used the same SD card on an older raspberry pi model B and it worked fine. I attached a screen shot of the message I receive. I am wondering if there is an issue with the raspberry pi itself not the software.
Pop out the SD card and then replace it (a couple of times). Sometimes just reseating the card will get it to boot-up. I have an RPi 2B that routinely refuses to boot (and there is nothing wrong with it!). I just try again (reseat the card) and try again... and then it will boot-up.

The push-push SD slot of the 2B is a problema... the newer push-pull slot of the 3B is much better.
marcus
:ugeek:

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: running sudo apt-get update not working

Wed Apr 20, 2016 4:55 pm

MarkHaysHarris777 wrote:Pop out the SD card and then replace it (a couple of times). Sometimes just reseating the card will get it to boot-up. I have an RPi 2B that routinely refuses to boot (and there is nothing wrong with it!). I just try again (reseat the card) and try again... and then it will boot-up.

The push-push SD slot of the 2B is a problema... the newer push-pull slot of the 3B is much better.
Looks to me like he booted, and is using terminal

He states 'sudo apt-get update' fails
DNPNWO

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:03 pm

Rive wrote: Looks to me like he booted, and is using terminal

... yeah, actually, he stated he ¨can´t get it to do anything else¨ which can mean, well, what?

Does it boot? What does ¨can´t get it to do anything else¨ mean? Is it dead, frozen, panic´d &c. did the boot fail in the middle... I really can´t read the text...
marcus
:ugeek:

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:05 pm

MarkHaysHarris777 wrote:
Rive wrote: Looks to me like he booted, and is using terminal

... yeah, actually, he stated he ¨can´t get it to do anything else¨ which can mean, well, what?

Does it boot? What does ¨can´t get it to do anything else¨ mean?
Well, since the image he attached clearly shows the Jessie GUI taskbar with an open terminal window... one might assume that he managed to boot up... Perhaps I am mistaken though.
Last edited by Rive on Wed Apr 20, 2016 5:12 pm, edited 1 time in total.
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:09 pm

mirrordirector.raspbian.org issue

Reboot pi, try again.

Image
Last edited by Rive on Wed Apr 20, 2016 5:17 pm, edited 4 times in total.
DNPNWO

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:12 pm

Now we have a larger image we can read, my hunch is shortage of file storage space on the root filesystem...

Running sudo raspi-config and selecting the first option might fix things.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:14 pm

Rive wrote:Well, since the image he attached clearly shows the Jessie GUI taskbar with an open terminal window... one might assume that he managed to boot up... right? Perhaps I am mistaken though.
No, you're not.
Most likely problem is a network related. The error msg says something along the lines that it cannot resolve the hostnames.
Cause so far unclear...

(Edit: although B.Good just made a good point about disk space)

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:27 pm

Worth checking on disk space with df -h (You don't want to see 100% in the first couple of lines.)

But actually a network issue is more likely.

The failure to run startx is because you are already running in an x-windowed environment - you cannot start it again from within itself. [Failure to do 'startx' from the boot-time shell prompt is indeed often because of space starvation, but on reflection you have already booted into the GUI, so that is not the case here.]

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:39 pm

B.Goode wrote:Worth checking on disk space with df -h (You don't want to see 100% in the first couple of lines.)

But actually a network issue is more likely.

The failure to run startx is because you are already running in an x-windowed environment - you cannot start it again from within itself. [Failure to do 'startx' from the boot-time shell prompt is indeed often because of space starvation, but on reflection you have already booted into the GUI, so that is not the case here.]
Maybe he is trying for root access?

Code: Select all

sudo su
startx
DNPNWO

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: running sudo apt-get update not working

Wed Apr 20, 2016 5:57 pm

Rive wrote: Maybe he is trying for root access?

Code: Select all

sudo su
startx
Not a good idea! DON'T do that!

lbyrnes86
Posts: 10
Joined: Tue Apr 05, 2016 12:50 am

Re: running sudo apt-get update not working

Wed Apr 20, 2016 7:48 pm

I tried both those commands, below are pictures of what response I got. Any command I try to run encounters some type of error.
Attachments
lauren.jpg
lauren.jpg (45 KiB) Viewed 1629 times
IMG_0643.jpg
IMG_0643.jpg (46.77 KiB) Viewed 1629 times

User avatar
jojopi
Posts: 3271
Joined: Tue Oct 11, 2011 8:38 pm

Re: running sudo apt-get update not working

Wed Apr 20, 2016 7:57 pm

You have plenty of space (only 59% used on /), and you do not need to expand the filesystem because you are using NOOBS.

The problems in the original post are networking errors (Temporary failure resolving archive.raspberrypi.org and mirrordirector.raspbian.org). It is unlikely that both repositories are down at the same time, so there is presumably a problem with your PI's connection to the internet.

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: running sudo apt-get update not working

Wed Apr 20, 2016 7:58 pm

Installing from NOOBS, you may later discover, has...disadvantages.

So, depending on what you plan to do, you might want to remove noobs, and install rasbian jessie directly using something like diskimager. (and then use diskimager to create ("read") backup images as needed for recovery later on)

On the average, I have diskimager 'read' the sdcard and create a backup image before/after I update/upgrade, install new programs, or do modifications.


Download Jessie:
https://www.raspberrypi.org/downloads/raspbian/

Download DiskImager:
https://sourceforge.net/projects/win32d ... t/download



If you want root user access:

Code: Select all

sudo su
startx
You may need to first uncheck "login as user pi" in raspi-config via menu/preferences (I dunno for sure though)..
DNPNWO

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: running sudo apt-get update not working

Wed Apr 20, 2016 8:26 pm

Rive wrote:Installing from NOOBS, you may later discover, has...disadvantages.

So, depending on what you plan to do, you might want to remove noobs, and install rasbian jessie directly using something like diskimager. (and then use diskimager to create ("read") backup images as needed for recovery later on)


Download Jessie:
https://www.raspberrypi.org/downloads/raspbian/

Download DiskImager:
https://sourceforge.net/projects/win32d ... t/download
The versions of Raspbian installed by NOOBS and by direct image are for practical purposes the same.

Re-installing will not of itself resolve the OPs networking problem.
If you want root user access:

Code: Select all

sudo su
startx
Running startx as the root user will probably make it difficult or impossible to subsequently run the Xwindows GUI as a 'normal' user such as 'pi'. I strongly advise against it.

You may need to first uncheck "login as user pi" in raspi-config via menu/preferences (I dunno for sure though)..

User avatar
DougieLawson
Posts: 39126
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: running sudo apt-get update not working

Thu Apr 21, 2016 11:51 am

So there's a need to look for network errors

ifconfig -a
ip route
ping -c3 $(ip route | awk '/default/ {print $3}')
ping -c3 8.8.8.8
ping -c3 google.com
cat /etc/resolv.conf
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”