This question already has an answer here:

I am getting this dkpg error when I try:

sudo dpkg --configure -a

Unable to find a workaround.

Using Ubuntu 16.04

marked as duplicate by Byte Commander, Pilot6, Sumeet Deshmukh, Zanna, Kaz Wolfe Jun 3 '17 at 6:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Review the contents of /var/lib/dpkg/updates/0040 – Panther Jun 2 '17 at 20:33
  • Probably easier to delete the file – Panther Jun 2 '17 at 20:35

File sounds corrupted run

sudo rm /var/lib/dpkg/updates/0040
sudo apt-get clean
sudo apt-get update
sudo apt-get install -f
sudo dpkg --configure -a

You can remove any other corrupted files in /var/lib/dpkg/updates/ if needed and re-run those commands.

Post any additional errors you may have

Not the answer you're looking for? Browse other questions tagged or ask your own question.