每次 apt-get 操作都会给我以下错误消息:
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
我尝试用这里描述的各种方法删除该包: 如何删除/安装未完全安装的软件包?
不幸的是我收到以下错误:
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
也不起作用
答案1
解决方案是按照说明手动卸载包这里:
要手动卸载损坏的软件包,请在 Debian 中以 root 身份运行以下两个命令,在 Ubuntu 中先运行 sudo:
mv /var/lib/dpkg/info/PACKAGE.* /tmp/
dpkg --remove --force-remove-reinstreq PACKAGE
PACKAGE
破损的包裹在哪里