When I run
sudo apt-get (anything), I invariably get this error:
dpkg: unrecoverable fatal error, aborting: files list file for package 'thunderbird-gnome-support' is missing final newline E: Sub-process /usr/bin/dpkg returned an error code (2)
After some Googling, I learn that this is because
/var/lib/dpkg/info/thunderbird-gnome-support.list is corrupt. I
cat that file, and it most certainly is corrupt - it should be a plain text file containing a list of absolute file paths, but instead is a binary file.
Now I inspect the other files in the same directory, and it appears that many of them are corrupt in the same way. This indicates that something went severely wrong in my file system, that caused many files to get corrupted. Unfortunately, it happened to affect system files.
How do I recover from this?
Just prior to this, I installed a routine update when Ubuntu prompted me. It was a new Linux kernel, and some system file headers.
After restarting, these were my specs:
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 13.10 Release: 13.10 Codename: saucy $ uname -a Linux brendang-linux 3.11.0-24-generic #41-Ubuntu SMP Mon Jun 9 20:36:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Immediately after restarting for the first time, the entire file system appeared to be mounted as read only (which has not been the case previously). Subsequently I have had to reboot several times before the system worked. I have done
touch /forcefsck in between them to ensure that
fsck runs, and am not sure what else needs to be done.