Another package I'm trying to install depends on the tzdata package, which remains unconfigured due to the following error:

$ sudo dpkg --configure tzdata
Current default time zone: 'America/New_York'
Local time is now:      Fri Feb 10 14:31:37 EST 2017.
Universal Time is now:  Fri Feb 10 19:31:37 UTC 2017.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

debconf: DbDriver "templatedb": rename failed: Is a directory
dpkg: error processing package tzdata (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:

But, simple as tzdata seems to be, I can't figure out what/where/how templatedb is supposed to exist. I tried searching the files brought in with tzdata but got nothing:

$ sudo dpkg -L tzdata | grep templatedb

Where can I find templatedb, and what is it supposed to be, if not a directory? (Or, more generally, how can I get tzdata to configure correctly so I can move on?)

  • Template database file is named template.dat. It is situated in /var/cache/debconf/ directory. May be there are some problems with access rights. Did you try to set tzdata under root account? Feb 10 '17 at 21:52
  • @OlegBolden Thank you! That helped me figure out what was wrong. I'll post an answer for the sake of completeness.
    – p.koch
    Feb 12 '17 at 21:49

Thanks to Oleg's comment, I found that my /var/cache/debconf/templates.dat file was, for some reason, a directory containing a single, empty file: poll.h. Not sure what put it there, but it seemed safe to delete, so I did. I then replaced templates.dat with templates.dat-old (there was also a templates.dat-new, neither of which were directories), ran sudo dpkg-reconfigure debconf, and then sudo dpkg --configure tzdata. Everything resolved fine.

This solved my issue, but I'm going to leave the question open in case someone else wants to give a more thorough explanation, since I don't really understand completely what all was going on.


Normally it can be a problem with debconf package

sudo apt-get install --reinstall debconf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.