dpkg:无法恢复的致命错误,aborting: files list file for package 'linux-generic' is missing final newline

分享于 

4分钟阅读

ubuntu

  繁體

问题:


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)



我已经尝试过


 sudo dpkg --configure -a 


 sudo apt-get -f install


 sudo apt-get clean


 sudo apt-get update && sudo apt-get upgrade




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




答案1:

我有类似的错误:


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)



(我在Raspbian上运行树莓派3)

我移动了以下文件:


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


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



然后运行:


sudo dpkg --configure -a


sudo apt update


sudo apt upgrade



解决了问题。


答案2:

我把所有的Linux文件移到别的地方,ex : ~/ (home ) sudo mv /var/lib/dpkg/info/linux* ./


sudo dpkg --configure -a


sudo apt update


sudo apt upgrade



解决了问题


答案3

首先你必须删除丢失的文件





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



现在你可以重新安装它





sudo apt-get install linux-generic --reinstall 




答案4

我遇到了这个问题:


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 也无法工作。

必须编辑 vim /var/lib/dpkg/info/rockchip-fstab.list

VH/.

这解决了这个问题。



文件  files  PAC  lis  列表  generic