Is it possible to force some preinst script to run before another?
What I would like to do, is create a package in my private repository, which when installed would FIRST ask some questions, and only then other packages (on which it depends) would be unpacked.
For example, let's say I want to create
my-mysql package, which would depend on
mysql-server-5.5 from standard repository. I would like when user types
apt-get install my-mysql for
my-mysql.preinst to run before
mysql-server-5.5.preinst (so it can do
debconf-set-selections to autogenerate root password and to stop mysql-server package from asking for it interactively).
I could do it without putting any depends in
my-mysql package, and manually running two commands:
apt-get install my-mysql apt-get install mysql-server-5.5
but I need it to work with only one command (
apt-get install my-mysql). I've tried playing with
Pre-depends on third package which would do config, and
Depends on mysql-server-5.5, but it seems
mysql-server-5.5.preinst always run first. Is there a way to change that and force my package preinst to run before it?
As alternative way, I also cannot run
apt-get install mysql-server-5.5 from postinst because of dpkg locking issues, and would like to do it in much cleaner way than locking kludges like this one.
UPDATE: as mentioned in the comments, it seems that mysql-server package also has
.config scripts (with associated
.templates) which execute even before
.preinst scripts, so I need to order them too.