Hosed my dedicated server the other day, but never lost ssh access nor use of dpkg. So I got it back gradually, using this advice plus some other tinkering.
What I had done was making two new sources lists by seding buster to bullseye and bookworm, respectively; and, without creating a preferences file for apt, installed a new package, mitmproxy. I didn't notice that it pulled the packages list from bookworm, two full distros ahead of the current buster. That was when the problems started, and I only made it worse from there.
Hint to future self: when apt tells you to type "Yes, do as I say!", don't.
last updated 2024-01-11 10:10:28. served from tektonic.jcomeau.com