dpkg: error processing package <package>: package is in a very bad inconsistent state; you should reinstall it before attempting configuration

Question:

I’m trying to do:

sudo apt-get update && sudo apt-get upgrade

but I’m getting the following error:

dpkg: error processing package python3-pip (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration

dpkg: error processing package python3-setuptools (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration

dpkg: error processing package python3-wheel (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration

Errors were encountered while processing:
 python3-pip
 python3-setuptools
 python3-wheel

E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried several solutions found but nothing helped. Also, it is happening with any software I try to install.

Asked By: R.K

||

Answers:

Try this answer from AskUbuntu: https://askubuntu.com/a/170808.

Apply it to the packages that are in a bad state. In your case, python3-pip, python3-setuptools, and python3-wheel:

sudo dpkg --remove --force-remove-reinstreq python3-pip python3-setuptools python3-wheel
sudo apt-get install python3-pip python3-setuptools python3-wheel
Answered By: LoganDark
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.