This is what I get when I tried to install git in Ubuntu 18.04. I may have asked a repeated question but I am not getting any solution.

kcn@kcn-UBUNTU:~$ sudo apt-get install gitReading package lists... DoneBuilding dependency tree Reading state information... Donegit is already the newest version (1:2.17.1-1ubuntu0.3).0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.3 not fully installed or removed.Need to get 0 B/7,732 B of archives.After this operation, 0 B of additional disk space will be used.Do you want to continue? [Y/n] ydpkg: error processing package libavahi-glib1:amd64 (--configure):package is in a very bad inconsistent state; you shouldreinstall it before attempting configurationdpkg: dependency problems prevent configuration of geoclue-2.0:geoclue-2.0 depends on libavahi-glib1 (>= 0.6.16); however:Package libavahi-glib1:amd64 is not configured yet.No apport report written because the error message indicates its a followup error from a previous failure.dpkg: error processing package geoclue-2.0 (--configure):dependency problems - leaving unconfigureddpkg: dependency problems prevent configuration of libgeoclue-2-0:amd64:libgeoclue-2-0:amd64 depends on geoclue-2.0 (= 2.4.7-1ubuntu1); however:Package geoclue-2.0 is not configured yet.dpkg: error processing package libgeoclue-2-0:amd64 (--configure):dependency problems - leaving unconfiguredNo apport report written because the error message indicates its a followup error from a previous failure.Errors were encountered while processing:libavahi-glib1:amd64geoclue-2.0libgeoclue-2-0:amd64E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to do the following:

kcn@kcn-UBUNTU:~$ sudo apt-get install git

[sudo] password for kcn:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure-a' to correct the problem.

So I typed

kcn@kcn-UBUNTU:~$ sudo dpkg --configure -a................................dpkg: error processing package libavahi-glib1:amd64 (--configure):package is in a very bad inconsistent state; you shouldreinstall it before attempting configuration
2

Best Answer


Try this out:

sudo dpkg --configure -asudo apt-get -f installsudo apt install libavahi-glib1 --reinstall

sudo dpkg --configure -a

Instruct dpkg to "fix" itself

sudo apt-get -f install

This will instruct apt-get to correct dependencies and continue to configure your packages.

sudo apt install libavahi-glib1 --reinstall

reinstall the "probelatic package"

First try reinstalling broken package like prompt says with e.g.

sudo apt-get install --reinstall libavahi-glib1