I had a problem updating my Ubuntu from the command line. If you get the error in the title, try this. Usually it will fail on boot after the upgrade. This seemed to help me. Make sure you are root:
Press ‘M’ for manual rescue. Enter the following in the prompt.
mount -n -o remount,rw / dpkg --configure -a
Hope this helps someone.