Not sure how this happened,, strange dpkg issue it seems like FS corruption or shutdown during a package install. Unusual to see that.
To get your system back on track, I suggest you try some combination of these commands (You might need to run each a couple of times depending) sudo dpkg --configure -a sudo apt-get -f install sudo apt install libavahi-glib1 --reinstall ** Changed in: avahi (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to avahi in Ubuntu. https://bugs.launchpad.net/bugs/1763758 Title: package libavahi-glib1:amd64 0.6.32~rc+dfsg-1ubuntu2.1 failed to install/upgrade: package is in a very bad inconsistent state; you should reinstall it before attempting configuration Status in avahi package in Ubuntu: Invalid Bug description: "System program problem detected" message appeared. ProblemType: Package DistroRelease: Ubuntu 16.04 Package: libavahi-glib1:amd64 0.6.32~rc+dfsg-1ubuntu2.1 ProcVersionSignature: Ubuntu 4.13.0-38.43~16.04.1-generic 4.13.16 Uname: Linux 4.13.0-38-generic x86_64 NonfreeKernelModules: wl ApportVersion: 2.20.1-0ubuntu2.15 Architecture: amd64 Date: Fri Apr 13 17:28:41 2018 DuplicateSignature: package:libavahi-glib1:amd64:0.6.32~rc+dfsg-1ubuntu2.1 Processing triggers for libc-bin (2.23-0ubuntu10) ... dpkg: error processing package libavahi-glib1: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 2018-01-19 (84 days ago) InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801) RelatedPackageVersions: dpkg 1.18.4ubuntu1.4 apt 1.2.26 SourcePackage: avahi Title: package libavahi-glib1:amd64 0.6.32~rc+dfsg-1ubuntu2.1 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/avahi/+bug/1763758/+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