For those using Debian or Ubuntu Linux, there are situations where the package management system can leave files open if a certain package fails, or if you cancel the installation using CTRL+C, you may see the following error when you try another package installation:
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Using the following command will tell you what’s using it:
fuser -v /var/cache/debconf/config.dat
This will give you the process ID in the right-hand column. You can then use kill {process ID} to remove this process and re run your apt-get command.