-1

Basically, I have removed python and now the OS is unusable.

I would like to reinstall Gnome but I am worried that all my documents on the boot partition will be lost. I don't care about the programs just for the data that I stored.

dr_
  • 29,602
  • 2
    backups, backups, backups – Rui F Ribeiro May 10 '17 at 17:40
  • Recommend, recommend, recommend me a link on how to do it :) – DerrickCrash May 10 '17 at 17:41
  • I just want to know, theoretically, if I don't format the boot partition, would I still have all the data in /home, also, I have two primary partitions with ext4. On which of these two should I reinstall Gnome? – DerrickCrash May 10 '17 at 17:48
  • By "reinstall", do you mean you're going to use the Debian install CD, and run the installer again, or do you mean you plan to use apt-get install? – derobert May 10 '17 at 17:49
  • @derobert Reinstall by using the Debian install cd – DerrickCrash May 10 '17 at 17:49
  • @GabrielBalan That seems drastic... I'd suggest apt install gnome or apt install task-gnome-desktop – derobert May 10 '17 at 17:51
  • @derobert It's my only option. Not booting, initramfs showing up, using a Live CD and creating a environment with chroot on which to install python didn't work. I am clueless right now. I've been using Linux for a year and a half now and I haven't had any issues with it, but generally I kept it safe, 'till now. – DerrickCrash May 10 '17 at 17:55
  • It's not booting (to text mode) even if you pick the recovery option in GRUB? Ok, that's broken... – derobert May 10 '17 at 17:57
  • You probably mean the root partition (/), not the boot partition (/boot/). The boot partition only contains bootloader files and the Linux kernel -- there's no way you would have stored your data there. – dr_ May 11 '17 at 07:09
  • Unless you stored your data on a separate partition or drive, (in this case '~/home' data) no you'll overwrite it. – SD Allen May 11 '17 at 18:33

1 Answers1

3

It's probably easier to repair the existing install, at least if the damage was caused by apt-get remove python or similar. But if you want to reinstall:

FIRST. You really ought to take a backup. The easiest way (since you can't boot the system) is probably a Debian Live DVD/USB stick/etc. Copy all your important files to, e.g., a USB hard disk. The Live disc gives you a normal desktop environment, so you can do that with the familiar file manager interface.

Do not proceed without a backup. It's far too easy to accidentally destroy your files.

If you have /home on a separate partition and make sure not to reformat /home when reinstalling, then your files will be preserved. Whether to format or not is an option in the installer.

Note that if you're running packages that manage their own data (for example, a database like MySQL or PostgreSQL, a mail server, a web or FTP server, etc.), that data may be stored in /var or /srv. In addition, things like cron store your user crontab in /var.

If everything is on one partition, then it's possible to tell the installer not to format it—but the install will fail, unless you've already cleaned up (e.g., via rm -Rf) all the system files. That'd basically be everything other than /home, and the exceptions mentioned above.

derobert
  • 109,670
  • Thank you. I will do this. Now I have just noticed that GRUB MININMAL BASH is working. Is there any way to repair it from here? – DerrickCrash May 10 '17 at 18:12
  • @GabrielBalan Grub minimal bash? I'm not sure if you mean the grub prompt (which isn't bash, or actually Linux) or the text-mode recovery prompt. If you type 'apt-get' at the prompt and hit enter, what does it reply? What does the prompt look like? (what text is it printing out as the prompt)? – derobert May 10 '17 at 18:15
  • Sadly, it shows 'can't find command'.GNU GRUB VERSION 2.02~beta+deb8u1. I have tried by pressing shift but the grub prompt won't come up. – DerrickCrash May 10 '17 at 18:18
  • @GabrielBalan OK, that's the grub command like prompt. Does pressing escape get you the grub menu? If not, it sounds like your grub config is messed up somehow—the installer's recovery mode might fix it for you. – derobert May 10 '17 at 18:19
  • No init found. Try passing init = bootarg. Target file system doesn't have requested /sbin/init. Mount: mounting /dev/sdb1 on /root failed: No such device. This is where the loading stops and it prompts me to initramfs. – DerrickCrash May 10 '17 at 18:31
  • 1
    @GabrielBalan that... does not seem like it could have possibly resulted from trying to remove python. If you want to try to repair the install, I think it'd help to edit your question with some more detail of exactly what you were doing when it broke. – derobert May 10 '17 at 18:34
  • https://unix.stackexchange.com/questions/363700/sudo-apt-get-remove-python-gnome-did-not-boot-tried-dpkg-unpack-deb – DerrickCrash May 10 '17 at 19:19
  • Sorry. I thought it was hopeless and I found a shred of light in your knowledge. – DerrickCrash May 10 '17 at 19:20
  • @GabrielBalan Reading your other question—I have two things thing to try (which I've posted there), other than that, I'm pretty sure if I was sitting in front of that system (for hours) I could get it running again—but I don't think I would; I'd reinstall. The step that I think broke badly it is the dpkg --unpack *.deb... – derobert May 10 '17 at 20:07
  • I reinstalled as you suggested. I will be more careful next time. Thank you for your help – DerrickCrash May 13 '17 at 12:22