Today I finally got around to upgrading my home media server to Ubuntu 12.04. I'd been putting it off for a while, mainly because I was busy and didn't have time to run extra backups. Anyways, everything ran smoothly until I forgot it was running and closed my Macbook lid, which resulted in no connection and a broken SSH pipe. This is the first time it's happened to me so I quickly did some googling and found the best solution.
Luckily the creators of Ubuntu planned ahead for this kind of thing and run a separate SSH Deamon (mine was port 1022) so I could connect to that using
ssh email@example.com -p 1022. Now that you're connected, you will notice everything is locked down. The entire file system will be locked down incluing apptitude, and you can't even resume using
dpkg --configure -a or
aptitude t -f dist-upgrade.
There is a screen instance running as the root user on th machine, which you can easily reconnect to using
screen -d -r. Once you are connected to this, you can easily resume wherever you were disconnected from. If you aren't logged in as root, which is good practice when you need to
sudo su to get to the root user, or
su root then enter the root password if you don't have sudo permissions. Thankfully that's all I needed to do to resume my upgrade.