Somehow two packages (that I don't want anymore) got corrupted after a file system check and are now missing files.
I installed and initialized
debsums and when I run it it gives a load of missing files (and only missing files).
I tried these commands (found all over the place):
sudo apt upgrade
sudo apt autoremove
sudo apt install brscan4
sudo apt remove brscan4
sudo dpkg --configure -a
sudo apt install --reinstall brscan4
sudo apt install -f --reinstall brscan4
sudo apt-get -f install(without package name)
sudo dpkg --remove --force-remove-reinstreq brscan4
sudo apt-get purge --remove brscan4
dpkg -P brscan4
dpkg --configure -a seems to be recommended everywhere as if it's the final last-resort solution that's supposed to fix it.
They all give the exact same error:
Removing brscan4 (0.4.4-3) ...
/var/lib/dpkg/info/brscan4.prerm: 3: /var/lib/dpkg/info/brscan4.prerm: /opt/brother/scanner/brscan4/setupSaneScan4: not found
dpkg: error processing package brscan4 (--remove): installed brscan4 package pre-removal script subprocess returned error exit status 127
These commands do nothing to the corrupted packages:
sudo apt update
sudo apt update --fix-missing
How can I fix this short of reinstalling Ubuntu from scratch? (his final solution, see chat)