Hello, After cloning virtual machines, I want to reconfigure packages in a fully automated fashion. In short, I've tried using "debian-set-selections" followed by "dpkg-reconfigure -f noninteractive", but it isn't actually changing the configuration. Here's a concrete example. Suppose I have installed postfix, preseeded in a particular way, then I want to reconfigure it for a new hostname. If I do the following interactively: dpkg-reconfigure -p high postfix then everything is fine: I get prompted with dialogs for the new
mail server configuration type and mailname, and then the relevant
files get updated and written out. root@foo1:~# dpkg-reconfigure -p high postfix Now I want to do this in a non-interactive script. So I try: root@foo1:~# debconf-set-selections <<EOS Nothing is updated. I have tried tracing the code through and I've got stuck. I can see these messages come from /var/lib/dpkg/info/postfix.postinst. It does some magic to check if a particular attribute has changed (e.g. "db_fget postfix/mailname changed"). The db_fget and db_fset functions are from /usr/share/debconf/confmodule which is doing some very low-level _db_cmd stuff. It seems to be talking over FD 3 to set or test which attributes have changed. My best guess is: the noninteractive frontend is saying "nope,
this setting has not been changed". So in summary: is there a general way for an already-installed package, to tell debconf either that specific setting(s) should be considered changed, or to reconfigure the package from scratch as if it were a new installation? Thanks, Brian. P.S. The authoritative documentation I found was: https://manpages.debian.org/testing/debconf-doc/debconf.7.en.html The latter mentions flags (FSET/FGET), and the "seen" flag in
particular, but not the "changed" flag. |