The package some-package needs to be reinstalled, but I can't find an archive for it.
I want to know what causes this error so that I can reproduce it and try to find safe ways of fixing it, even when the broken package is important and has many dependencies. This bit of the APT source code might give a bit of a clue, but I don't know how packages get the status that causes the error.
How can I produce this error for testing on my (Ubuntu MATE 17.10) system?
This is prompted by this recent Ask Ubuntu question and my long-standing discomfort with closing questions about this error against Apt/Synaptic needs to reinstall package but can't find the archive for it, whose answer uses
dpkg --force-all to remove the offending package. Anonymous feedback suggests this solution has worked for many users, but I am not confident that using
--force-all won't cause later problems, or that it's a good idea to use this method to remove important packages like APT.