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)

  • Yes.. I've tried that. That's why I asked this question. I get the same output. Errors were encountered while processing: usb-modeswitch-data – Control C Control V Mar 11 '21 at 00:58
  • I edited the question – Control C Control V Mar 11 '21 at 01:02
  • Fascinating. Normally, a reinstall will explain the problem in more detail. It's usually much more helpful than that. Oh, well. Time to try dpkg's --force options. Start with a light touch, and work your way up. Save --force-remove-reinstreq for last, since that's the nuclear option, and you must clean up afterward manually. – user535733 Mar 11 '21 at 01:05
  • Thanks for the advice, I think ill try dpkg's --force options after one-two days depending if I get more answers. – Control C Control V Mar 11 '21 at 01:40
  • wget -c http://mirrors.kernel.org/ubuntu/pool/main/u/usb-modeswitch-data/usb-modeswitch-data_20170806-2_all.deb and sudo dpkg -i usb-modeswitch-data_20170806-2_all.deb – nobody Mar 11 '21 at 11:54

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
  • Uhh it says "Command 'apt-file' not found, but can be installed with:

    apt install apt-file" but my apt is broken

    – Control C Control V Mar 11 '21 at 00:34
  • You do not need it I show the files needing to be removed using it. You simply take that list and remove them, then edit the status file I mention to remove the listing for the package. It is not the normal way to do it but the only way I can see for you to get it working again. –  Mar 11 '21 at 03:19
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
  • 2