0

Im using Ubuntu 18.04 and I ran into a problem with apt. Im trying to install Node JS but I get this error whenever trying to install things:

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)

The output of sudo-apt-get install -f gives me:

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)

This command: sudo dpkg --configure -a outputs:

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

From all this, I can tell that usb-modeswitch-data is messing things up. When i try to remove it I get:

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

Output when trying to reinstall:

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)

2 Answers2

0

Absolute worse case hack, if necessary will do it, delete the files manually and edit the /var/lib/dpkg/status to remove its reference to it as being installed. The files you need to delete below, then the reference in the file.

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
0

I dont want to sound like "The IT Crowd", but have you tried uninstalling it and reinstalling it?!

this may help?!

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

U18.04 is built on DEB, should work. Hope this helps!

MasaM
  • 1