This is a weird problem and I can't find a direct solution.
I ran sudo apt-get update && sudo apt-get upgrade -y
(I haven't ever run it on this machine but it is Ubuntu server 12.04 like all the others).
It goes through the updates and get part way through upgrade then I get this error
(Reading database ... 80%dpkg: unrecoverable fatal error, aborting:
files list file for package 'mysql-common' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
Now I am getting this same error when I try to run any apt-get command.
I have tried:
apt-get clean
apt-get autoremove
apt-get install -f mysql-common
apt-get install --reinstall mysql-common
And maybe some others that I can't think of now.
Most of the time, not always, and I can recollect exactly what commands it happens on (I have been hacking at this for a while now) it ends with that error. I am still unable to update.
Any ideas?
Edit
Rehatcc's answer lead me to check out the mysql-common.files per the error files list file for package 'mysql-common' is missing final newline
The file is just garbage text.
Is this like a template file that is generic across all systems? Can I just paste in the text from another system?