It seems fairly implausible that the "$rtlddir/$rtld_so" would become a directory for any reason. If that were the case, `dpkg-divert` (being a dynamic executable) would fail to start. Most likely, it is the first diversion that fails here. Since the package at hand is `:amd64`, `rtlddir=/lib64`. So for some reason, `/lib64` is a directory on your installation and not a symbolic link. In effect, this is (at least partially) an unmerged system and this is unsupported.
This still is a bug in the sense that the error message is very confusing. `libc6.preinst` should probably be verifying that `$rtlddir` really is a symbolic link before adding the diversion. In the end, the outcome would be the same: When `$rtlddir` is not a symbolic link, all that `libc6.preinst` can do is fail (with a better error message).
I don't fully understand the situation at hand, but let me add some background.
From the log it seems fairly clear that `lib6.preinst` is the thing that fails here. It adds two diversions:
dpkg-divert --quiet --add --no-rename --package base-files --divert "/.${rtlddir# /}.usr- is-merged" "$rtlddir" $rtld_so. usr-is- merged" "$rtlddir/$rtld_so"
dpkg-divert --quiet --add --no-rename --divert "$rtlddir/
It seems fairly implausible that the "$rtlddir/$rtld_so" would become a directory for any reason. If that were the case, `dpkg-divert` (being a dynamic executable) would fail to start. Most likely, it is the first diversion that fails here. Since the package at hand is `:amd64`, `rtlddir=/lib64`. So for some reason, `/lib64` is a directory on your installation and not a symbolic link. In effect, this is (at least partially) an unmerged system and this is unsupported.
This still is a bug in the sense that the error message is very confusing. `libc6.preinst` should probably be verifying that `$rtlddir` really is a symbolic link before adding the diversion. In the end, the outcome would be the same: When `$rtlddir` is not a symbolic link, all that `libc6.preinst` can do is fail (with a better error message).