Troubleshooting ubuntu: dpkg: unrecoverable fatal error, aborting: files list file for package ‘linux-generic’ is missing final newline

If you ever encounter with such similar of an error (in my case it occurred on my Ubuntu 20 distro), you may apply the following process to get a fix. 

The error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
apt apt-transport-https apt-utils dpkg libapt-inst2.0 libapt-pkg5.0 ntpdate
oracle-java8-installer oracle-java8-set-default thermald
10 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/4,389 kB of archives.
After this operation, 8,192 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
files list file for package 'linux-generic' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

Disclaimer: it worked for me, that doesn’t necessary means that would work same for you! However, you may give it a try.

remove or move the missing file

sudo rm /var/lib/dpkg/info/linux-generic.list

Now you can again reinstall it

sudo apt-get install linux-generic --reinstall

or

sudo dpkg --configure -a
sudo apt update
sudo apt upgrade

(The later one worked, I suppose the first one should work as well)

Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.