Manipulating debconf settings on the command lineFeeding the Cloud
<a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>
https://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/Feeding the Cloudikiwiki2017-12-04T23:38:53Zhttps://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/comment_1_3eefecaedc6fca8d3005acce4c2ccd8f/Sven Mueller2012-11-04T04:30:26Z2010-10-18T20:30:30Z
<p>I would use</p>
<p>debconf-get-selections | grep application > file</p>
<p>and edit the file, then use</p>
<p>debconf-set-selections < file</p>
<p>to load the changed settings.</p>
https://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/comment_2_712f6e28a2b39c05fc3596ecb0e85e66/cjwatson2012-11-04T04:30:26Z2010-10-19T08:08:02Z
<p>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?).</p>
<p>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.</p>
<p>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.</p>
https://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/comment_3_11e4a24237641e78fc63d16ab5460a7f/Grant McLean2012-11-04T04:30:26Z2010-10-20T20:40:46Z
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.
workaroundhttps://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/comment_4_3e0e8e7fe1639af6f0d2afdc4a69c3ec/draeath2017-12-04T23:38:53Z2017-12-04T22:05:56Z
<p>You can edit /var/cache/debconf/config.dat manually instead, but be aware that you can really break things by editing this.</p>
<p>The file it uses for configuration is defined in /etc/debconf.conf, should it not be where you expect on your system</p>
<pre><code># World-readable, and accepts everything but passwords.
Name: config
Driver: File
Mode: 644
Reject-Type: password
Filename: /var/cache/debconf/config.dat
</code></pre>