55

I am getting error while using sudo apt-get upgrade stating:

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

It does not seem to block the installation/upgrade other applications. I believe this problem arose due to direct shutting down of my PC while the application was being upgraded.

How can I fix this?

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
Barun
  • 725

6 Answers6

84

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

sudo apt-get install --reinstall packagename 
muru
  • 207,228
50
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.

Oli
  • 299,380
8
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

6

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.

edwinksl
  • 24,109
Anower Perves
  • 161
  • 1
  • 4
3

If you want to fix this through GUI, you can use synaptic. Synaptic is an excellent package management tool that used to be included in older versions of ubuntu. To install it:

sudo apt-get install synaptic

click on fix broken packages.

Mijo
  • 293
3

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

edwinksl
  • 24,109
c0degeas
  • 141