1

Good Day All,

I recently experienced an issue with my Raspberry-Pi 2B that caused it to boot into a black screen after using the following commands:

sudo apt-get update && sudo apt-get upgrade

I am currently running Raspbian Stretch on an 8GB SD Card. After much research, I found that the cause of this issue was possibly due to the SD card running out of space.

Kind Regards,

Shen

Shen
  • 21
  • 1
  • 5

2 Answers2

1

A solution to the problem is given below. Wanted to share my solution to this problem as I see many people are experiencing it with few solutions that actually work, short of formatting and a clean install.

  • One solution presented here suggested to expand the file system using:
    sudo raspi-config then Advance Options > Expand Filesystem
  • Another user cited this problem suggesting it arose when attempting to update over a poor WIFI connection which resulted in corrupted files. The solution provided to was to updated over a more stable connection.

Unfortunately, these solutions where not applicable to me as I had both a stable internet connection and later discovered that NOOBs handles the Expand Filesystem function automatically by default.

Provided that you have already enabled SSH and are able to dial into your Raspberry PI, the following approach did solve my problem:

  1. Determine the IP Address of your Raspberry PI so that you can SSH into it. The forum post here shows how to do this on windows using wireshark. This is best done over a local network connection to the Raspberry PI.

  2. Log in using your custom username and password or the default values of Username: pi and Password: raspberry if you have not set changed the default settings.

  3. Once you have gained access to your Raspberry PI through a SSH terminal, clean your installation using sudo apt-get clean. The explanation as to why this works can be found here. In short, the files from previous updates are left on the SD Card and need to be cleared manually.

  4. Once you have cleaned your installation, reboot the Raspberry PI manually or through the command terminal.

This was the only solution that worked for me and now my Raspberry PI is functional again without having to format and re-image. I hope this solution brings all the elements needed for this problem in one place and will everyone a lot of time and frustration.

Kind Regards,

Shen

Shen
  • 21
  • 1
  • 5
  • 1
    Posting an answer to your own question is fine, but you should still divide the question and answer into the respective sections. Other people might provide a different answer to the actual question. – Brick Apr 23 '19 at 18:02
  • Hello and welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. If possible please follow Brick's advice and separate your answer from the question. (Note that there is nothing wrong in providing question and answer at the same time, you may also accept your own answer.) – Ghanima Apr 23 '19 at 18:36
  • Thank you for the guidance, I have separated the question and answer from itself. – Shen Apr 24 '19 at 06:30
0

The "answer" in the question is at best a short term fix - it will happen again.

The full version of Raspbian is barely usable on an 8GB SD Card, and installing it from NOOBS (which wastes over 1GB) just compounds the problem!

Get a 16GB SD Card or install Raspbian Stretch with desktop if you want to use a 8GB SD Card.

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • You are correct that a bigger SD Card would be desirable but it still does not address the issue that Raspbian does not clean up excess files after updating, which lead to the situation above.

    Hence, one will eventually cap any size of SD Card, with enough updates overtime, unless this becomes an automatic clean up feature.

    – Shen Apr 24 '19 at 06:25
  • If you use apt rather than apt-get you will have less problems, but running out of space is inevitable - don't use NOOBS and install Raspbian Stretch with desktop and you will have a workable OS. df -h will show how little space you have to work with. – Milliways Apr 24 '19 at 06:34
  • Thank you, I will try using apt instead of apt-get and will change to Raspbian Stretch with desktop on my next Install. I intially used the df command to diagnose the disk space issue but the df -h command is much more useful!

    Thank you again for all the advice! I am new to Raspberry PI programming and will definitely make use of what you have mentioned.

    – Shen Apr 24 '19 at 06:42