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)
但是,/var/lib/dpkg/info/linux
如上一篇文章所述,该文件夹在我的系统中不存在。(我在 Raspberry pi 3 上运行 Raspbian)
我移动了以下文件:
/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* 文件移到了其他地方。例如:~/ (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 安装 linux-generic --reinstall
答案4
我遇到了这种错误并且很容易地解决了它。
Selecting previously unselected package curl.
dpkg: unrecoverable fatal error, aborting:
files list file for package 'm17n-db' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)
以下是我解决此错误的方法:
转到然后在文本编辑器中/var/lib/dpkg/info/m17n-db.list
打开/m17n-db.list
您将在该文件文本的最后一行看到一个空白的新行,如下所示:
你只需要这样做:
- 如果有空的新行,请删除。
- 然后使用管理员密码保存文件。好了。所有问题都解决了。