Got into a fight with Ubuntu's "Software Updater" yesterday.
After doing a "sudo apt update && sudo apt upgrade" got a string of error messages regarding a metric ton of system packages like this:
gconf2 is broken or not fully installed
This appeared to be the result of apt losing its mind. On Red Hat derived systems the solution would be to rebuild the yum (or dnf) database and clear all caches.
After trying all the other solutions offered in this post without success, I finally followed the procedure described in response 11:
If all else fails. What I did was I first changed the directory to:
cd /var/lib/dpkg/info
then I removed everything with .postinst:
sudo rm *.postinst
then update repository
sudo apt-get update
then everything went back to normal when I did:
sudo apt-get --force-yes install openjdk-7-jre-headless