How to fix "Package is in a very bad inconsistent state" error?

Edited out of the question and added as an answer.

  1. Make sure that your PPA is set up.

  2. Remove the broken package via the following command:

    sudo dpkg --remove --force-remove-reinstreq zramswap-enabler
    
  3. Install the package again:

    sudo apt-get install zramswap-enabler
    
  4. After restart (not necessary), you are able to install the updates correctly!

Actually you can fix any "Package is in a very bad inconsistent state” issues with this solution!


This worked for me after pretty much scouring the whole of AskUbuntu and Ubuntu forums! (Source). I'm running Lubuntu 14.04

sudo mv /var/lib/dpkg/info/<packagename>.* /tmp/
sudo dpkg --remove --force-remove-reinstreq <packagename>
sudo apt-get remove <packagename>
sudo apt-get autoremove && sudo apt-get autoclean

I had a situation worse than this. I had to remove the half-installed packages by forcing dependencies.

sudo dpkg --remove --force-remove-reinstreq --force-depends <package-name>

Then I had to reinstall them

sudo apt-get -f install

That should solve any issue. But please make sure you have network connectivity when you try to do this. Otherwise, you will have to go through even more trouble.