Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 2948  / 1 Year ago, fri, march 3, 2023, 5:08:42

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?


More From » apt

 Answers
5

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.


[#29251] Saturday, March 4, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scusaper

Total Points: 335
Total Questions: 111
Total Answers: 119

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
scusaper questions
Fri, Apr 15, 22, 15:26, 2 Years ago
Wed, Mar 15, 23, 03:53, 1 Year ago
Sat, Jun 4, 22, 18:03, 2 Years ago
;