Problem Description:
Although it can happen very rarely sometimes the dpkg, run by apt-get or aptitude, gets confused and leaves the lock on the mounting of its database open after being terminated. This prevents any further operations on installing, updating or configuring packages. The error would look like this:
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Here is a good solution taken from:
https://bugs.launchpad.net/ubuntu/+source/debconf/+bug/349469
Solution:
As a resolution to the immediate lock problem, https://wiki.edubuntu.org/DebuggingInstallationIssues recommends using the following command to determine the process holding the lock and then killing it.
fuser -v /var/cache/debconf/config.dat