dpkg error package is in a very bad inconsistent state

step refer

  1. check PPAs

    need check:

    1
    /etc/apt/sources.list
  2. clean/delete broken package

    may need run command:

    1
    2
    3
    4
    5
    6
    7
    8
    ## clean
    sudo apt autoremove
    sudo apt autoclean
    ## reconfig
    sudo dpkg --configure -a
    ## unintsall / reinstall
    sudo dpkg --remove --force-remove- reinstreq <package-name>
    sudo apt install --reinstall <package-name>

fix

尝试 dpkg --configure -a

1
2
3
4
5
6
7
8
9
emgda@Server1:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of software-properties-gtk:
software-properties-gtk depends on python3-aptdaemon.gtk3widgets; however:
Package python3-aptdaemon.gtk3widgets is not configured yet.

dpkg: error processing package software-properties-gtk (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
software-properties-gtk

尝试重新安装 python3-aptdaemon.gtk3widgets

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
emgda@Server1:~$ sudo apt-get remove python3-apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
archdetect-deb aufs-tools bogl-bterm casper cifs-utils discover discover-data dmraid dpkg-repack gksu kpartx kpartx-boot libdebian-installer4 libdiscover2 libdmraid1.0.0.rc16 libgksu2-0 libglade2-0
libparted-fs-resize0 libvte-common libvte9 localechooser-data plymouth-x11 python-cairo python-glade2 python-gobject-2 python-gtk2 python-vte python3-icu python3-pam rdate ubiquity-casper
ubiquity-ubuntu-artwork user-setup
#...
dpkg: error processing package libpackagekit-glib2-16:amd64 (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of gir1.2-packagekitglib-1.0:
gir1.2-packagekitglib-1.0 depends on libpackagekit-glib2-16 (>= 0.8.17-4ubuntu6~gcc5.4ubuntu1.5); however:
Package libpackagekit-glib2-16:amd64 is not configured yet.

dpkg: error processing package gir1.2-packagekitglib-1.0 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
libpackagekit-glib2-16:amd64
gir1.2-packagekitglib-1.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

emgda@Server1:~$ sudo apt-get install python3-apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
archdetect-deb aufs-tools bogl-bterm casper cifs-utils discover discover-data dmraid dpkg-repack gksu kpartx kpartx-boot libdebian-installer4 libdiscover2 libdmraid1.0.0.rc16 libgksu2-0 libglade2-0
libparted-fs-resize0 libvte-common libvte9 localechooser-data plymouth-x11 python-cairo python-glade2 python-gobject-2 python-gtk2 python-vte python3-icu python3-pam rdate ubiquity-casper
ubiquity-ubuntu-artwork user-setup
Use 'sudo apt autoremove' to remove them.
Suggested packages:
python3-apt-dbg python-apt-doc
The following NEW packages will be installed:
python3-apt
0 upgraded, 1 newly installed, 0 to remove and 92 not upgraded.
2 not fully installed or removed.
#...

再清理一遍重新安装

1
2
3
4
sudo apt autoremove
sudo dpkg --configure -a
sudo apt install --reinstall libpackagekit-glib2-16:amd64
sudo apt autoremove

ok

refer

help with apt-get upgrade!!!

sudo apt-get update
sudo apt-get upgrade
to see what state the system is now in.

ibjsb4
August 11th, 2013, 04:19 AM
This happen on a upgrade from 12.10 to 13.04?

Looks like you tried most all the standard fixes, if this is a upgrade bug you may just have to reinstall. Even though you have tried standard fixes, give this a try:

sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update
sudo apt-get dist-upgrade

Dpkg: error processing package python3-aptdaemon

Solution:
sudo apt-get remove python3-apt
sudo apt-get install python3-apt
sudo apt remove python3-aptdaemon
sudo apt install python3-aptdaemon

How to fix “Package is in a very bad inconsistent state” error? 如何修复“包处于非常糟糕的不一致状态”错误?

  1. Make sure that your PPA is set up.

  2. Remove the broken package via the following command:

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

    1
    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!

    在诉诸卸载导致问题的任何内容之前,我会尝试清理我的安装状态:

    1
    2
    3
    4
    apt-get autoclean
    apt-get update
    apt-get upgrade
    apt-get install -f
作者

Wei Mo

发布于

2022-03-11

更新于

2024-06-03

许可协议

评论