On Mon, Dec 30, 2024 at 08:38:17PM +0000, Nikolaus Rath wrote:
If a system crashed while dpkg was installing a package, then my
assumption has always been that it's possible that at least this package
is corrupted.
You seem to be saying that dpkg needs to make sure that the package is
installed correctly even when this happens. Is that right?
dpkg tries really hard to make sure the system is *still functional*
when this happens. If you skip the syncs you may end up with a system
where (for example) libc6 is effectively gone and the system won't boot
back up. There may certainly still be issues where an upgrade is in
progress and some of the pieces don't interact properly, but the intent
is that should result in a system which can be fixed by completing the
install, vs issues which prevent the system from getting to the point of
completing the install. Skip enough syncs and you may not even be able
to recover via a rescue image without totally reinstalling the system
because dpkg wouldn't even know the state of the packages.