I had a slightly different issue but the solution was very similar. When I ran the dpkg command it didn't list any bad packages, though when I updated it still told me there was a package in a very bad state. I used:
sudo apt-get install --reinstall libssl1.0.0:i386 (this was listed in my term.log file as bad) and now everything is updating/installing properly. I'm running Ubuntu 16.04 on an intel dual core i7. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to openssl in Ubuntu. https://bugs.launchpad.net/bugs/1692981 Title: package libssl-dev:amd64 1.0.2g-1ubuntu11.2 failed to install/upgrade: package is in a very bad inconsistent state; you should reinstall it before attempting configuration Status in dpkg package in Ubuntu: Confirmed Status in openssl package in Ubuntu: Confirmed Bug description: package libssl-dev:amd64 1.0.2g-1ubuntu11.2 failed to install/upgrade: package is in a very bad inconsistent state; you should reinstall it before attempting configuration ProblemType: Package DistroRelease: Ubuntu 17.04 Package: libssl-dev:amd64 1.0.2g-1ubuntu11.2 ProcVersionSignature: Ubuntu 4.10.0-21.23-generic 4.10.11 Uname: Linux 4.10.0-21-generic x86_64 ApportVersion: 2.20.4-0ubuntu4.1 AptOrdering: libssl1.0.0:amd64: Install NULL: ConfigurePending Architecture: amd64 Date: Tue May 23 21:47:55 2017 DuplicateSignature: package:libssl-dev:amd64:1.0.2g-1ubuntu11.2 Setting up libssl1.0.0:amd64 (1.0.2g-1ubuntu11.2) ... dpkg: error processing package libssl-dev:amd64 (--configure): package is in a very bad inconsistent state; you should ErrorMessage: package is in a very bad inconsistent state; you should reinstall it before attempting configuration InstallationDate: Installed on 2017-05-15 (7 days ago) InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412) RelatedPackageVersions: dpkg 1.18.10ubuntu2 apt 1.4 SourcePackage: openssl Title: package libssl-dev:amd64 1.0.2g-1ubuntu11.2 failed to install/upgrade: package is in a very bad inconsistent state; you should reinstall it before attempting configuration UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/1692981/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp