Srini's Point of View

My thoughts on technology, food and other fancies…

Lost SSH During Ubuntu Update

I was trying to install security updates on my digitalocean vps and lost my ssh connection. The one time I was not using tmux! GAH!! It was also stuck at a stage where it was waiting for me to put in what config changes to use for some software package (use my previous or use the default)

When I logged in again and tried to run the apt-get update again, I saw the following error -

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

So had to find my running process and kill it. Even after killing it, I was seeing the same error. Turns out I can resume my upgrade from where my ssh connection died, using the following command -

% sudo dpkg --configure -a