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


I got a same "half-installed package" problem with a package kibana. I got the following error:

dpkg: error processing kibana (--configure):
package kibana is not ready for configuration
cannot configure (current status 'half-installed')
Errors were encountered while processing:
  kibana
E: Sub-process /usr/bin/dpkg returned an error code (1)

If anyone is still facing this kind of problem, then you can try this:

sudo rm /var/lib/dpkg/info/kibana*
cd /var/cache/apt/archives
sudo rm kibana*
apt-get --reinstall install kibana

This works for me. You just need to replace the word 'kibana' with your half-installed package name.


This should fix your problem without re-installing the package.

sudo dpkg --force-remove-reinstreq --remove <package_name here>

Followed by: sudo apt-get update