Neil asks about removing debconf old values when replacing a package with a different one.

Usually, you shouldn't need to worry about this; when the old package is finally purged all its debconf values will be cleaned up. In case that doesn't happen for some reason, you do not need to include the templates in the new package in order to get them removed. Actually, due to debconf's reference counting, that shouldn't work anyway.

What you need is debconf-communicate(1). Specifically, something like this in a maintainer script of the new package, before it sources debconf's confmodule:

echo purge | debconf-communicate oldpackage

(Updated: Fixed incorrect syntax!)


Meh, databases add such complexity.. If I were redesigning debconf today, it would use flat files on disk and those files would be removed by dpkg on purge.