The error in question occurs during the postinst for /var/lib/dpkg/info/libapache2-mod-php7.4, where it is following this logic:
PHP_MODULE=$(a2query -m | sed -n 's/^\(php[\.0-9]*\) (enabled.*)/\1/p')
if [ -n "$PHP_MODULE" -a "$PHP_MODULE" != "php7.4" ]; then apache2_msg "err" "$DPKG_MAINTSCRIPT_PACKAGE: $PHP_MODULE module already enabled, not enabling PHP 7.4"
return 1
fi
I wonder if instead of erroring at this point, it instead ran dismod on the other modules, if it would resolve this problem. I.e., something more like:
PHP_MODULE=$(a2query -m | sed -n 's/^\(php[\.0-9]*\) (enabled.*)/\1/p')
if [ -n "$PHP_MODULE" -a "$PHP_MODULE" != "php7.4" ]; then apache2_msg "info" "$DPKG_MAINTSCRIPT_PACKAGE: Disabling $PHP_MODULE in favor of using PHP 7.4" apache2_invoke dismod $PHP_MODULE || exit 1
fi
The error in question occurs during the postinst for /var/lib/ dpkg/info/ libapache2- mod-php7. 4, where it is following this logic:
if [ -n "$PHP_MODULE" -a "$PHP_MODULE" != "php7.4" ]; then
return 1
fi
I wonder if instead of erroring at this point, it instead ran dismod on the other modules, if it would resolve this problem. I.e., something more like:
if [ -n "$PHP_MODULE" -a "$PHP_MODULE" != "php7.4" ]; then
fi