在安装任何软件时,我都会收到“软件包‘gnupg’的文件列表文件缺少最后一个换行符”

在安装任何软件时,我都会收到“软件包‘gnupg’的文件列表文件缺少最后一个换行符”
Package operation failed
The installation or removal of a software package failed.

installArchives() failed: Selecting previously unselected package libidn11:i386. 
(Reading database ... 
(Reading database ... 5% 
(Reading database ... 10% 
(Reading database ... 15% 
(Reading database ... 20% 
(Reading database ... 25% 
(Reading database ... 30% 
(Reading database ... 35% 
(Reading database ... 40% 
(Reading database ... 45% 
(Reading database ... 50% 
(Reading database ... 55%
dpkg: unrecoverable fatal error, aborting: 
 files list file for package 'gnupg' is missing final newline 
Error in function: 
SystemError: E:Sub-process /usr/bin/dpkg returned an error code (2)

答案1

似乎某个特殊文件已损坏。在目录中,/var/lib/dpkg/info您会找到该文件gnupg.list。查看内部。您可能会看到损坏。删除此文件是安全的。因此,打开终端并输入

sudo rm /var/lib/dpkg/info/gnupg.list

完成软件包数据库(sudo apt update或任何其他工具)的更新后,现在您应该得到正确的gnupg.list信息,并且错误应该会消失。

相关内容