Fix half-installed package

For the half installed package error, --reinstall worked for me:

sudo apt-get install --reinstall packagename 

sudo dpkg --remove --force-remove-reinstreq --dry-run libgfortran3:amd64

That's just a dry-run. I'm not sure what removing libgfortran3 will take with it but run that and see. Assuming it's not going to gobble the whole system, run it again without the --dry-run and then you can sudo apt-get install ... the packages you need back.


sudo apt install --reinstall packagename

This works like charm. It resolved an issue that I had been experiencing for months. My case was with the package libmysqlcppconn7v5

All I did was run sudo apt install --reinstall libmysqlcppconn7v5