1

Basically I decided to switch from GNOME 3 to MATE. So I installed MATE (mate_desktop_environment_extras and ran it and then (while still in MATE) I made the mistake of consulting Debian Wiki on how I should delete GNOME.

aptitude purge dpkg --get-selections | grep gnome | cut -f 1
aptitude -f install
aptitude purge `dpkg --get-selections | grep deinstall | cut -f 1
aptitude -f install

Except, among the dependencies of GNOME written in the Terminal's obituary were core MATE packages. Naturally I turned my computer off hoping somehow nothing essential was deleted. I was so wrong. GRUB works, but a standard boot takes me to a text-based log in which didn't work.

So, the next issue was how to get Internet connection (to install packages) since the wifi I was using has to be authenticated by PEAP or something like that which I found impossible to do with the standard iwconfig. Instead I set up a hotspot on my phone which I'm now using. After getting internet I tried to reinstall whatever I had lost (I'm not entirely sure) with Aptitude.

Didn't work so I installed Synaptic which tried to install missing things for me. Most packages installed, some didn't, but that's not important. Basically I installed packages in stages, whatever synaptic threw at me (that stuck). At various points dpkg would be "interrupted" and I needed to

sudo dpkg --configure -a

Until I was met with a warning that it couldn't write to /var/lib/dpkg/status because "no space left on device". A df tells me that dev/loop0 and dev/loop1 are full. I look up what they are used for but all of the ways to recover space involved dpkg.

In /var/lib/dpkg/status I figured out that if I deleted some of it then there would be more room for writing to it. Except I broke the file. So I tried deleting it and recreating it. Didn't work.

So, basically I have no idea how to fix dpkg specifically and my computer in general.

The silver lining in all of this is that I was at least sagacious enough to install grml as a backup. That's how I'm typing this. It works but I'd still like my computer back.

Sorry for the rant. At first I would have said that I didn't want to start from scratch but at this point I really don't care. The catch is that I do not have a live CD.

Um, so what do I do? I'll try and answer any questions you have.

UPDATE: (since I can't comment) So I'm not really sure how this grml (http://grml.org/files/) backup is partitioned from the other crap but /var/backups/dpkg.status.0 cannot stat because it does not exist. Thank you so much for taking the time to write that response though. What does exist? ls -av (grml@grml) reveals

.  boot grml-live initrd.img.old media proc sbin tmp vmlinuz 
.. dev home lib mnt root srv usr vmlinuz.old 
bin etc initrd.img lib64 opt run sys var

No backups of dpkg status to be found. To clarify I did df and learned "dev/loop"s 0 and 1 were full. To clear space I had the brilliant idea to break dpkg status, remember? So I have no idea how to clear space there basically. Also, I should have mentioned it, but I'm using debian. I know this is askubuntu but the user community at our daughter distro is amazing so I figured I'd give this a shot. I should have done this earlier but uname -a

Linux grml 3.16.0-1-grml-amd64 #1 SMP Debian 3.16.7-1+grml.1
(2014-11-05) x86_64 GNU/Linux

grml is made for system rescue but I guess it's a fairly obscure tool. Basically I'd like to delete everything else and use this wifi to install a fresh deb on a new partition.

UPDATE AGAIN: So I just broke dpkg on this grml partition. It's on my main partition. The problem is I can't get internet to connect there (debian rescue). My hotspot is open but I can't get an access point associated, whatever that means.

FINAL UPDATE: turns out I forgot to ifconfig wlan0 up. My computer is running beautifully on mate, gnome is purged, and I didn't lose any other data! Happy ending.

1 Answers1

1

At this point, your system is probably pretty much toast, and has been through a lot.

While repairing it is possible (but very hard now), there could be a lot of very large problems that should be solved with something stronger than duck tape.

Ideally, you should just reinstall your system, making a backup of any important to be restored later.


Now, if a reinstall is not an option, you can duck-tape the system to try to fix it.

First off, get your (handy) backup of /var/lib/dpkg/status out. You do have one, no? If you don't, sorry, you're toast Linux decided to be very nice to you. You have a working version at /var/backups/dpkg.status.0.

Copy your backup over:

sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

Now, you need to get dpkg back up and running. cd /tmp to get to somewhere not important, and get the `dpkg binary:

apt download dpkg

Try to reinstall it, and pray that it works. If not, we have much bigger problems.

sudo dpkg -i dpkg*.deb

Once that works, reinstall your Ubuntu base:

apt-get download base-files
sudo dpkg -i base-files*.deb

If all still looks well, instruct dpkg to clean and rebuild everything:

dpkg --audit
sudo apt-get update
sudo apt-get check

Once everything is back where it belongs and the lesson of the day (Don't ever interrupt an active dpkg task, or mess with dpkg/status), we need to re-install your graphical interface:

sudo apt install --reinstall ubuntu-mate-desktop

This will then take everything that's needed for MATE and install it (again) to ensure that everything works how it's supposed to.

As for cleaning up hard drive space, you can use du and df to trace where all of that space is, and clean it up by hand.

Some info sourced from here

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172