It's not very easy to find information on how to adjust debconf settings after a package has been installed and configured. Most of the information out there is for Debian developers wanting to add support for debconf in their maintainer scripts.

I ran into the problem of being unable to change a package's configuration options through dpkg-reconfigure and I found the following commands to do it manually:

debconf-show packagename

to show the list of debconf values that a package has stored,

echo "get packagename/pgsql/app-pass" | debconf-communicate

to query the current value of an option in the debconf database, and

echo "set packagename/pgsql/app-pass password1" | debconf-communicate

to change that value.

I'm not convinced that this is the easiest way for system administrators to manually lookup and modify debconf options, but that's the best I could find at the time.

I would use

debconf-get-selections | grep application > file

and edit the file, then use

debconf-set-selections < file

to load the changed settings.

Comment by Sven Mueller

This is as easy as it gets, as far as I'm aware; debconf-set-selections is different but not really any easier (do you know exactly what it does to seen flags?).

It would be possible to write some kind of shiny interface to edit the debconf database. I think that all the people who know debconf well enough to do this have probably avoided doing so because we're afraid that then people really would start treating it like an equivalent of the Windows registry.

If dpkg-reconfigure doesn't work, and if (more importantly) there isn't something in /etc you can edit instead of having to change values in debconf, then it's a bug in the package and should be reported as such.

Comment by cjwatson
A tangential topic but ... having debconf ask for a password just seems wrong anyway. For the specific example of an application needing to know a Postgres password, I'd be inclined to manage a .pgpass file using Puppet.
Comment by Grant McLean