Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
tried to remove/purge mysql, and then update/upgrade and install it again? Just might work.. –  Alvar Sep 26 '13 at 20:28

1 Answer 1

up vote 5 down vote accepted

Go to:

cd /var/lib/dpkg/info

Type

ls -l mysql*

If a file comes up such as "mysql-common.list" or "mysql-common.md5sums" or anything, do the following:

sudo mv ./mysql-common.list ~/mysql-common.list

and if this exist

sudo mv ./mysql-common.md5sum ~/mysql-common.md5sum

Reboot the system. Then let us know what is your status afterwards (not working... working... semi working...)

Note: If they are there in that directory, cat them open and see if there is a blank line at the end or hidden characters etc. (cat ./mysql-common.md5sum). If you are unable to tell if there are hidden characters in those files messing them up run do this (it removes all letters and numbers and slashes which would be in those files):

cat ./mysql-common.list | egrep -v [[:alpha:]]

Anything showing after that except /. or /.. is your problem line.

share|improve this answer
    
My dude. Maybe your way is better than mine but this is what I did. I copied and pasted the contents from another machines mysql-common.list file and it worked like a charm. Thanks for pointing me in the right direction. –  dan08 Sep 26 '13 at 20:51
1  
Anytime brother. Glad I could help (which isn't that often haha!) Also don't forget if I were use, i would repair the mysql installation just to make sure there are no lingering bugs still lying around that might cause this again! –  RedHatcc Sep 26 '13 at 20:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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