21
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)

I already tried the usual stuff like:

 sudo dpkg --configure -a 
 sudo apt-get -f install
 sudo apt-get clean
 sudo apt-get update && sudo apt-get upgrade

Any help, thanks!

cat -net /var/lib/dpkg/info/linux-generic.list
     1  ^LbM-BM-^FRq^MU^Evalueq^NK^HubU^Mcertificationq^ONU^Hoverviewq^PNU$
     2  updated_atq^QNU^Vavailable_translationsq^RNU^Dyearq^SMM-CM-^]^GU^Fimagesq^TNU^Bidq^UNU^Ipaused_atq^VNU^Eindex
4
  • Please edit your question to include the output of cat -net /var/lib/dpkg/info/linux-generic.list Apr 27 '17 at 23:40
  • I tried copying the linux-generic.list from a good ubuntu machine and it still doesn't work. May 7 '17 at 18:41
  • Copied how exactly? the cat -net output you posted earlier appears to show a mess of Windows control characters (CR endings and byte order mark) - did you use a word processing program (Word / LibreOffice) by any chance? May 7 '17 at 18:44
  • the corrupted linux-generic.list was output was copied from putty I used scp to copy from a working ubuntu machine to the corrupted one, replacing the bad one May 7 '17 at 19:36
27

I had similar issues with the following error:

dpkg: unrecoverable fatal error, aborting:
 files list file for package 'libboost-regex1.55.0:armhf' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

However, the folder /var/lib/dpkg/info/linux didn't exist on my system, as in previous post. (I was running Raspbian on a Raspberry pi 3)

I moved the following files:

/var/lib/dpkg/info/libboost-regex1.55.0:armhf.postrm
/var/lib/dpkg/info/libboost-regex1.55.0:armhf.list

Then ran:

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

It fixed the problem for me.

4
  • 1
    For this particular question, you would run: sudo rm /var/lib/dpkg/info/linux-generic.list and then you might need to reinstall the package: sudo apt install --reinstall linux-generic
    – mchid
    Nov 10 '19 at 17:38
  • 1
    Thanks that worked. BUT I had to do a sudo apt-get install --reinstall <missing_library> as the final step
    – Wavesailor
    Nov 20 '19 at 16:28
  • This worked for me !! Thanks .
    – Afsal
    Aug 18 '20 at 1:26
  • Worked for me with a the aforementioned reinstallation. Otherwise, throws "dpkg: warning: files list file for package 'PACKAGENAME' missing; assuming package has no files currently installed"
    – M1GEO
    Jan 8 at 16:21
9

I finally had some time to fix this on my own. For future reference

I moved all the linux* files to somewhere else. ex: ~/ (home) sudo mv /var/lib/dpkg/info/linux* ./

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

That fixed it

1
  • 3
    Did not work for me. It did add extra errors: dpkg: warning: files list file for package 'linux-base' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'linux-libc-dev:armhf' missing; assuming package has no files currently installed
    – Qwertie
    Feb 19 '19 at 12:34
7

Firstly you have to remove that missing file

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

Now you can again reinstall it

sudo apt-get install linux-generic --reinstall 
0

I had this issue:

dpkg: unrecoverable fatal error, aborting:
 files list file for package 'rockchip-fstab' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

sudo dpkg --configure -a also did not work for me.

So, I had to edit by vim /var/lib/dpkg/info/rockchip-fstab.list as:

/. from V\H

Which fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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