Powered By Blogger

Freitag, 5. April 2013

Repairing dpkg after connection dropped and preventing that in the future

Recently I was logged in to my server via SSH, as suddenly the connection (UMTS network) dropped. The last command I ran was apt-get upgrade. Unfortunately, SSH does not resume a lost connection. When I issued apt-get upgrade again, I got an error that /var/cache/debconf/config.dat would be locked by another process. To solve that, it is possible to use the fsuer command:

fuser -v /var/cache/debconf/config.dat

The locking process can be killed with "kill -9 PID".

To prevent things like that happen in the future, I then installed "screen". When I log into my SSH server, I run screen and then work. If the connection drops again, I connect to my SSH server and say "screen -r" to get back to my previous session. Very useful. :-)