Package: dpkg Version: 1.20.7.1 Severity: wishlist When upgrading a package, it is by no means unheard of for many of its files to preserve their contents (though not necessarily their metadata). This phenomenon is particularly common for minor upgrades, as with stable updates or many upgrades within development suites (testing, unstable, and experimental). In this era of reproducible builds, it commonly even extends to compiled binaries such as shared libraries, whose upgrades currently always trip needrestart.
It would be great if dpkg could handle this scenario with less formal disruption. At minimum, instead of unconditionally renaming .dpkg-new files into place, perhaps it could compare them with the files they are to replace (after confirming that they are in fact regular files) and in the case of an exact match simply resync metadata and remove corresponding .dpkg-new files. A more elaborate approach could reduce peak disk usage in many cases: immediately after creating a .dpkg-new file, compare it with the file it is to replace, and in the case of an exact match discard the .dpkg-new file in favor of an empty file with an extension of (say) .dpkg-newmeta and the desired permissions and ownership. The rename phase would then check for such .dpkg-newmeta files and proceed accordingly. Thanks in advance for considering this suggestion! -- Package-specific info: -- System Information: Debian Release: bullseye/sid APT prefers testing-security APT policy: (500, 'testing-security'), (500, 'testing-debug'), (500, 'testing'), (500, 'stable'), (300, 'unstable-debug'), (300, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386, x32 Kernel: Linux 5.10.0-5-amd64 (SMP w/8 CPU threads) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages dpkg depends on: ii libbz2-1.0 1.0.8-4 ii libc6 2.31-11 ii liblzma5 5.2.5-2 ii libselinux1 3.1-3 ii tar 1.34+dfsg-1 ii zlib1g 1:1.2.11.dfsg-2 dpkg recommends no packages. Versions of packages dpkg suggests: ii apt 2.2.2 pn debsig-verify <none> -- no debconf information