So I was trying to install the Python library lzma, and somehow I got to the point of removing python2.x, and I don't know why I did that. I'm tired, that probably why. I think I learned my lesson.

Anyways the damage is done. I ran apt-get remove python. It then preceded to remove a crap ton of other stuff stuff related to python, and also a bunch of programs I had installed. I do not know why this happened. I rebooted, and now I don't know what exactly happened to it, so I'm just going to take a picture. enter image description here

It is just stuck on that. I tried pressing Ctrl-Alt-T for a terminal, nope, didn't do anything.

Luckily I have an SSH server that starts on boot, and I successfully logged into that, and I have root.

I have a bunch of files on there that I cannot lose. Im also an idiot for not taking backups.

How can I restore my Pi back to what it was like before?

I have tried:

  • apt-get dist-upgrade

  • apt full-upgrade

  • apt-get install python

EDIT: I do have NOOBS installed on the sdcard, so I can hold shift while booting to get into NOOBS

Also the Pi in question is an RPi3, and it was on Raspbian Pixel

Update: I logged into SSH and ran sudo raspi-config and made it so the Pi just boots to CLI.

  • You would be better off using SSH (SCP unix.stackexchange.com/questions/106480/…) to retrieve your unbacked up files and starting fresh. Take this as a learning opportunity and implement a proper backup procedure for the new system. Jun 19, 2017 at 7:46
  • @Steve Robillard dang. ok. that kinda sucks to because they are scattered all over the system Jun 19, 2017 at 7:47
  • Just learn the lesson as much as it may hurt or a PITA, it is far worse the second time when you know better. Jun 19, 2017 at 7:48
  • @SteveRobillard So right now All I got on me is my phone (rooted Nexus6p) a few flash drives and my Pi setup. The flash drives are 4gb, 16gb & 32gb. You mind helping me figure out how to fix this? Pi does have ADB installed Jun 19, 2017 at 7:51
  • @SteveRobillard and an OTG cable Jun 19, 2017 at 7:52

1 Answer 1


Removing Python is not a minor issue the resulting problems can lurk unseen for a long period of time only to bite you later (e.g. a missing library that was uninstalled and not reinstalled breaks a seldom used feature). As a result, I think you would be better off backing up the important files you mentioned using SCP and starting over, by reimaging your SD card.

To copy files from your Pi to your PC I would suggest winscp. If you are using a MAC or another Linux machine SCP is built in. This tutorial should get you going.

Some additional things to consider:

  • Do you still need noobs or should you just switch to Raspbian directly?
  • How you manage the files and scripts you mention are scattered all over the file system.
  • Implementing a backup solution.
  • Right now im just adb pushing everything important Jun 19, 2017 at 8:12
  • Whatever works to backup your important files before reimaging the SD card. Jun 19, 2017 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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