出现的问题代码:

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

解决方法:

1.删除所有关于丢失的文件,再重新安装
sudo rm /var/lib/dpkg/info/libselinux1*
apt-get install libselinux1 --reinstall
2.备份info中所有文件然后重新配置和更新
sudo mv /var/lib/dpkg/info/linux* ./
sudo dpkg --configure -a
sudo apt update
sudo apt upgrade

如果出现下面warning:

dpkg: warning: files list file for package 'linux-base' missing; assuming package has no files currently installed

再次执行以下命令:

sudo apt-get install --reinstall linux-base

这样就将问题解决了

===========================
作者:一个刁民 来源:CSDN 原文:https://blog.csdn.net/wuyoulv/article/details/82895984