the target installation has a symlink lib -> usr/lib. The deb archive contains a file './lib/systemd/system/a.service' When removing (update does remove the old packet as well), dpkg will do the following: lstat("/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 rmdir("/.") = -1 EINVAL (Invalid argument) lstat("/lib", {st_mode=S_IFLNK|0777, st_size=7, ...}) = 0 unlink("/lib") = 0 lstat("/lib/systemd", 0x7ffe2f87b8d0) = -1 ENOENT (No such file or directory) lstat("/lib/systemd/system", 0x7ffe2f87b8d0) = -1 ENOENT (No such file or directory) That leads two 2 problems: 1. the /lib symlink is now gone, rendering the system unusable. 2. cleanup is done bottom up, means in this case it fails to remove everything else.
Fixed in git.