The problem is that the postrm script is trying to unregister modules after all of the .scm's have been removed from the system. The reason this works on the second run of apt-get remove is that the file listing all of the installed modules gets removed during the first run so it doens't try to remove any modules the second time, so it doesn't fail. You will notice however that if you reinstall uim-common, you will get a bunch of "module already registered" warnings.
The fix is simply to rename the debian/uid-common.postrm script to debian/uid-common.prerm so that the modules will be unregistered before they are removed from the system. -stew
signature.asc
Description: This is a digitally signed message part