Wednesday, May 8, 2013

debconf: DbDriver "config": could not open /var/cache/debconf/config.dat

Chances are, you'll run into a few odd errors with Ubuntu's apt-get package manager. I've had my fair share; there was one that struck me as kind of odd. Luckily there was a simple solution. In my case, one such issue that popped up was that there was a conflict in a dependency and apt-get couldn't resolve it. In trying to resolve it, I issued apt-get -f install. It still failed on me.

root@axis:~# apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 63 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
debconf: DbDriver "config": could not open /var/cache/debconf/config.dat
Setting up man-db ( ...
debconf: DbDriver "config": could not open /var/cache/debconf/config.dat
dpkg: error processing man-db (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

It had me stumped at first- I tried clearing the cache and even rebuilding the apt-get config files. Turns out the issue is much simpler; there was no /var/cache/debconf directory!

 After issuing mkdir /var/cache/debconf, I was able to proceed with the rest of the update. The hint was: debconf: DbDriver "config": could not open /var/cache/debconf/config.dat. Like any good sysadmin, I decided to see what was in /var/cache/debconf- but as the directory didn't exist.. I created it manually and ran the command again.



  1. i tried this, but it gives me this error debconf: DbDriver "config": could not open /var/cache/debconf/config.dat

  2. Did you make sure the directory exists? Do "ls -lad /var/cache/debconf" to see. If it doesn't exist, you need to create it as root ("sudo mkdir /var/cache/debconf"). It is also possible that if your directory does exist, and config.dat is corrupted, that you'll need to move the existing config.dat out of the way ("sudo mv /var/cache/debconf/config.dat ~/." - this will put it in your home directory) and do an "apt-get clean" and try running the install again.

  3. Holy heck. I know you posted this months ago, but after messing around in aptitude, triple checking my sources list, and finally drilling down until I got that error (could not open /var/cache/debconf/, where previously I was getting a generic failure on linux-image-2.6.32-5-686 package, this saved me. Quickly made the directory, and re-ran the dist-upgrade. That's one less coffee I'll need today ^__^_
    Thank you.