dpkg:错误处理软件包 usb-modeswitch-data(--configure):软件包处于非常糟糕的不一致状态;

dpkg:错误处理软件包 usb-modeswitch-data(--configure):软件包处于非常糟糕的不一致状态;

我使用的是 Ubuntu 18.04,遇到了问题apt。我尝试安装,Node JS但每次尝试安装东西时都会出现此错误:

dpkg: error processing package usb-modeswitch-data (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 usb-modeswitch-data
E: Sub-process /usr/bin/dpkg returned an error code (1)

输出结果为sudo-apt-get install -f

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 0 B/30.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package usb-modeswitch-data (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 usb-modeswitch-data
E: Sub-process /usr/bin/dpkg returned an error code (1)

此命令:sudo dpkg --configure -a输出:

dpkg: error processing package usb-modeswitch-data (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 usb-modeswitch-data

从这一切来看,我可以看出这usb-modeswitch-data把事情搞砸了。当我尝试删除它时,我得到了:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  usb-modeswitch-data*
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 96.3 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: error processing package usb-modeswitch-data (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 usb-modeswitch-data

尝试重新安装时的输出:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/30.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package usb-modeswitch-data (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 usb-modeswitch-data
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

绝对最糟糕的黑客攻击,如果有必要,会这样做,手动删除文件并编辑/var/lib/dpkg/status以删除其对已安装的引用。您需要删除下面的文件,然后删除文件中的引用。

zeus@buster-raspi:~$ apt-file list usb-modeswitch-data
usb-modeswitch-data: /lib/udev/rules.d/40-usb_modeswitch.rules
usb-modeswitch-data: /usr/share/bug/usb-modeswitch-data/presubj
usb-modeswitch-data: /usr/share/doc/usb-modeswitch-data/NEWS.Debian.gz
usb-modeswitch-data: /usr/share/doc/usb-modeswitch-data/README.Debian
usb-modeswitch-data: /usr/share/doc/usb-modeswitch-data/README.gz
usb-modeswitch-data: /usr/share/doc/usb-modeswitch-data/changelog.Debian.gz
usb-modeswitch-data: /usr/share/doc/usb-modeswitch-data/changelog.gz
usb-modeswitch-data: /usr/share/doc/usb-modeswitch-data/copyright
usb-modeswitch-data: /usr/share/lintian/overrides/usb-modeswitch-data
usb-modeswitch-data: /usr/share/usb_modeswitch/configPack.tar.gz

答案2

我不想听起来像“IT 狂人”,但是你尝试过卸载它并重新安装它吗?!

这可能有帮助?!

https://kreationnext.com/support/how-to-install-usb-modeswitch-data-on-debian-unstable-sid/

U18.04 是基于 DEB 构建的,应该可以工作。希望这能有所帮助!

相关内容