Fixing a borked ubuntu installation

Recently after a shutdown my Linux box started to act really weird. All of a sudden /dev/null wasn’t writeable, sftp wouldn’t initialize and there were funny errors on startup about being unable to find an image. I couldn’t really see a culprit on dmesg or any of the logs so I must confess I was stumped. Luckily I did some googling before a reinstall and found there was an alternative.

This article says that you essentially need 3 apt-get commands and your install should get fixed. I must confess I had tried the first two but hadn’t thought of the 3rd. That one appears to have done the trick. Now everything seems to work.

For future reference the commands are, apt-get update; apt-get upgrade; apt-get dist-upgrade

The article I’ve linked to goes into more detail about doing this from a recovery CD if your install is completely broken but I was lucky, I could still get into my box so I didn’t need to use the rest of the instructions.

I’m assuming the same procedure would work on Debian too.