Had the same issue on ubuntu 22 in 2025. Thanks to Stephen Kitt's answer I was able to figure it out.
My issue was not only about libglib but about libnunit too.
To make the uninstall go smoothly I had to trash not only the .postrm files but also the .prerm files of /var/lib/dpkg/info/libnunit*.
And after uninstalling successfuly I took a look at each of those trashed file to try to manually uninstall what I could.
And it turns out that some of those files try to uninstall /usr/share/cli-common/gac-package-remove libnunit-core-interfaces2.6.3-cil by using - instead of .. I was able to fix it by sudo /usr/share/cli-common/policy-remove nunit.core.interfaces 2.6 on the nunit files I had trashed.
Here is the content of those files:
File: libnunit-console-runner2.6.3-cil.postrm_1 #!/bin/sh set -e # Automatically added by dh_cligacpolicy/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove nunit-console-runner 2.6 fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-core2.6.3-cil.postrm #!/bin/sh set -e # Automatically added by dh_cligacpolicy/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove nunit.core 2.6 fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-core-interfaces2.6.3-cil.postrm #!/bin/sh set -e # Automatically added by dh_cligacpolicy/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove nunit.core.interfaces 2.6 fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-core-interfaces2.6.3-cil.prerm #!/bin/sh set -e # Automatically added by dh_installcligac/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/gac-package-remove ]; then /usr/share/cli-common/gac-package-remove libnunit-core-interfaces2.6.3-cil fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-framework2.6.3-cil.postrm #!/bin/sh set -e # Automatically added by dh_cligacpolicy/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove nunit.framework 2.6 fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-framework2.6.3-cil.prerm #!/bin/sh set -e # Automatically added by dh_installcligac/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/gac-package-remove ]; then /usr/share/cli-common/gac-package-remove libnunit-framework2.6.3-cil fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-mocks2.6.3-cil.postrm #!/bin/sh set -e # Automatically added by dh_cligacpolicy/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove nunit.mocks 2.6 fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-mocks2.6.3-cil.prerm #!/bin/sh set -e # Automatically added by dh_installcligac/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/gac-package-remove ]; then /usr/share/cli-common/gac-package-remove libnunit-mocks2.6.3-cil fi # End automatically added section ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── File: libnunit-util2.6.3-cil.postrm #!/bin/sh set -e # Automatically added by dh_cligacpolicy/UNDECLARED if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove nunit.util 2.6 fi # End automatically added section