Hello,
I'm trying to perform a task during debian/package.config which
requires another package to be installed. I initially thought
pre-depends would be strong enough, because [1] describes it by:
This field is like Depends, except that it also forces dpkg to
complete installation of the packages named **before even starting
the installation of the package which declares the pre-dependency,**
as follows:
(my emphasis). However, reading the next paragraphs does not appear to indicate any requirements are attempted to be satisfied before debconf/ pre-configure questions are asked (only preinst, unpack, and configure
are explicitly mentioned).
Indeed, trying to install a package with a pre-depends on certbot that
has a debconf debian/config file does not have certbot installed by
the time the debconf script starts. This is on testing.
My question: is there a way to ensure a package is installed *before*
getting debconf input from the user? Alternatively, is there a way to
run debconf questions during a preinst script? Just doing
db_get package/template
db_go
doesn't seem to work (it does nothing?). Am I doing something wrong? Is
there a preferred way to do this?
Best,
Antonio
[1] https://www.debian.org/doc/debian-policy/ch-relationships.html
Indeed, trying to install a package with a pre-depends on certbot that
has a debconf debian/config file does not have certbot installed by the
time the debconf script starts. This is on testing.
My question: is there a way to ensure a package is installed *before*
getting debconf input from the user? Alternatively, is there a way to
run debconf questions during a preinst script?
Antonio Russo <aerusso@aerusso.net> writes:
Indeed, trying to install a package with a pre-depends on certbot that
has a debconf debian/config file does not have certbot installed by the
time the debconf script starts. This is on testing.
See section 8 of the debconf specification:
The config-file contains a new element, which I call the
configmodule. This is a program that will determine the configuration
before the package is unpacked. This means it is usually run before
the preinst, and before the package is unpacked!
This could definitely be clearer (and easier to find), but yes, this is expected behavior.
My question: is there a way to ensure a package is installed *before*
getting debconf input from the user? Alternatively, is there a way to
run debconf questions during a preinst script?
The tripwire package prompts in preinst, so that worked at some point, but it's for an old upgrade so I don't know if it's still working. I think
it's more common to prompt in postinst during configure. I know of
several packages that do that, although it's not considered ideal if you
can avoid it.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 360 |
Nodes: | 16 (2 / 14) |
Uptime: | 128:30:47 |
Calls: | 7,686 |
Files: | 12,828 |
Messages: | 5,711,088 |