Ubuntu – apt-get -f install hangs on Unpacking linux-headers-4.4.0-66-generic

aptdpkg

I am running Ubuntu 16.04 and when trying to unpack linux-headers-4.4.0-66-generic apt hangs indefinitely. I terminated the apt process, removed the stale lock files, and ran:

sudo apt-get clean
sudo dpkg --configure -a

and the result is:

dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 4.4.0.66.70);
however:
Version of linux-headers-generic on system is 4.4.0.64.68.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic

I then ran:

sudo apt-get update
sudo apt-get ugrade

with the following result:

...
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 4.4.0.66.70) but 4.4.0.64.68 is installed
E: Unmet dependencies. Try using -f.

Running
apt-get -f install
starts the cycle over again and I can't get these issues with apt hanging and linux-generic installing properly.

Any ideas?

Best Answer

I ran into the same problem after my computer lost power during an update process. The top answer from this thread helped me:

How to remove package in bad state, software center freezes, no synaptic

Related Question