1

Every apt-get operations gives me the following error message:

dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /var/cache/apt/archives/python-gtk2-dev_2.24.0-3ubuntu4_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/python-gtk2-dev_2.24.0-3ubuntu4_all.deb

I tried to remove the package in various ways described here: How to remove/install a package that is not fully installed?

Unfortunately I get the following error:

sudo dpkg -P python-gtk2-dev                    
dpkg: error processing package python-gtk2-dev (--purge):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 python-gtk2-dev

sudo apt-get install --reinstall python-gtk2-dev also doesn't work

Jan B
  • 265
  • 3
  • 11

1 Answers1

5

The solution was to manually uninstall the package as described here:

To manually uninstall the broken package run the two commands below as root in Debian, preceded by sudo in Ubuntu :

mv /var/lib/dpkg/info/PACKAGE.* /tmp/
dpkg --remove --force-remove-reinstreq PACKAGE

where PACKAGE is the broken package

Jan B
  • 265
  • 3
  • 11