Comment 3 for bug 1310811

Manfred Hampl (m-hampl) wrote :

Just a guess based on https://answers.launchpad.net/ubuntu/+source/apt/+question/251022

Text snipped from the preinst script

if [ -n "$2" ] && dpkg --compare-versions "$2" 'lt' '2.4.7-1~' && dpkg --compare-versions "$2" 'ge' '2.4.1-1' ; then
 CUR_MPM=$(a2query -M) || exit 1
 if [ "$CUR_MPM" == "itk" ] ; then
  echo "apache2-mpm-itk" >> /etc/apache2/.apache2_mpm_selected
 fi
fi

At the moment that the preinst script is executed, the executable /usr/sbin/a2query does not yet exist.

I guess the line "CUR_MPM=$(a2query -M) || exit 1" would have to be put inside an "if [ -x '/usr/sbin/a2query' ]"

Similar with the postrm script that also tries accessing some files that just have been deleted, see bug #1308722