最近在ubuntu安装软件时报错:
dpkg: error processing package apport (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
apport
E: Sub-process /usr/bin/dpkg returned an error code (1)
大意就是要重装apport,搜索了下apport就是个报告系统崩溃的程序,果断舍弃.操作如下:
sudo dpkg --remove --force-remove-reinstreq apport
若以上命令卸载不了,请往下看
sudo vim /var/lib/dpkg/status
在文件里用/Package: apport
快速找到apport软件部分,如下:
Package: apport
Status: deinstall reinstreq half-configured
Priority: optional
Section: utils
Installed-Size: 760
Maintainer: Martin Pitt <martin.pitt@ubuntu.com>
Architecture: all
Version: 2.20.1-0ubuntu2.10
Config-Version: 2.20.1-0ubuntu2.10
Replaces: core-dump-handler, python-apport (<< 2.2-0ubuntu1)
Provides: core-dump-handler
Depends: python3, python3-apport (>= 2.20.1-0ubuntu2.10), lsb-base (>= 4.1+Debian11ubuntu7), python3-gi, gir1.2-glib-2.0 (>= 1.29.17), init-system-helpers (>= 1.18~)
Recommends: apport-symptoms, policykit-1, python3-systemd
Suggests: apport-gtk | apport-kde
Breaks: python-apport (<< 2.2-0ubuntu1)
Conflicts: core-dump-handler
发现状态描述部分出现错误,将status文件中的apport描述部分全部删除(注意修改权限)。
保存关闭文件.
再次安装软件包就不会报错啦~