After patching xlibs.postinst and creating a new package with dpkg-repack, dpkg -i calls postinst correctly:
# LC_ALL=C dpkg -i xlibs_4.2.1-6_i386.deb (Reading database ... 128883 files and directories currently installed.) Preparing to replace xlibs 4.2.1-6 (using xlibs_4.2.1-6_i386.deb) ... Unpacking replacement xlibs ... Setting up xlibs (4.2.1-6) ... + THIS_PACKAGE=xlibs + THIS_SCRIPT=postinst + SOURCE_VERSION=4.2.1-6 + trap 'message; message "Received signal. Aborting xlibs package postinst script."; message; exit 1' HUP INT QUIT TERM + which readlink + '[' -e /usr/X11R6/lib/X11/xkb.moved-by-preinst -a -L /usr/X11R6/lib/X11/xkb ']' + '[' -e /usr/X11R6/lib/X11/app-defaults.moved-by-preinst -a -L /usr/X11R6/lib/X11/app-defaults ']' + check_symlinks_and_bomb /usr/X11R6/lib/X11/xkb /usr/X11R6/lib/X11/app-defaults+ '[' -n '/usr/X11R6/lib/X11/xkb /usr/X11R6/lib/X11/app-defaults' ']' + PROBLEM= + '[' -L /usr/X11R6/lib/X11/xkb ']' ++ maplink /usr/X11R6/lib/X11/xkb ++ echo /etc/X11/xkb ++ readlink /usr/X11R6/lib/X11/xkb + '[' /etc/X11/xkb '!=' /etc/X11/xkb ']' + '[' -n '' ']' + PROBLEM= + '[' -L /usr/X11R6/lib/X11/app-defaults ']' ++ maplink /usr/X11R6/lib/X11/app-defaults ++ echo /etc/X11/app-defaults ++ readlink /usr/X11R6/lib/X11/app-defaults + '[' /etc/X11/app-defaults '!=' /etc/X11/app-defaults ']' + '[' -n '' ']' + grep -qs '^/usr/X11R6/lib$' /etc/ld.so.conf + '[' configure = configure ']' + ldconfig + exit 0 Calling dpkg with -D2 leads to a core-dump before postinst is invoked. So it seems to be a bug fully caused by dpkg. I will try to find out which files and under which circumstances are not correctly installed by dpkg (installed as .dpkg-new and deleted afterwards, that is) as soon as I have more time. Greetings, Dennis

