![无法安装任何软件包:“软件包 linux-image-5.4.0-42-generic 缺少最后的换行符”?](https://linux22.com/image/1028110/%E6%97%A0%E6%B3%95%E5%AE%89%E8%A3%85%E4%BB%BB%E4%BD%95%E8%BD%AF%E4%BB%B6%E5%8C%85%EF%BC%9A%E2%80%9C%E8%BD%AF%E4%BB%B6%E5%8C%85%20linux-image-5.4.0-42-generic%20%E7%BC%BA%E5%B0%91%E6%9C%80%E5%90%8E%E7%9A%84%E6%8D%A2%E8%A1%8C%E7%AC%A6%E2%80%9D%EF%BC%9F.png)
我尝试在我的 Ubuntu 20.04.5 上安装一些软件包更新,但一切都失败了:
dpkg: unrecoverable fatal error, aborting:
files list file for package 'linux-image-5.4.0-42-generic' is missing final newline
我该如何解决这个问题?
这是我尝试过的示例:
> sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
Try Ubuntu Pro beta with a free personal subscription on up to 5 machines.
Learn more at https://ubuntu.com/pro
The following NEW packages will be installed:
linux-headers-5.15.0-52-generic linux-hwe-5.15-headers-5.15.0-52 linux-image-5.15.0-52-generic linux-modules-5.15.0-52-generic linux-modules-extra-5.15.0-52-generic
The following packages will be upgraded:
code docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin git git-man gitk gthumb gthumb-data libasn1-8-heimdal libgssapi3-heimdal libhcrypto4-heimdal
libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libksba8 libroken18-heimdal libwind0-heimdal linux-generic-hwe-20.04
linux-headers-generic-hwe-20.04 linux-image-generic-hwe-20.04 linux-libc-dev unzip zlib1g zlib1g:i386 zlib1g-dev
28 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
23 standard LTS security updates
Need to get 0 B/286 MB of archives.
After this operation, 606 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Extracting templates from packages: 100%
dpkg: unrecoverable fatal error, aborting:
files list file for package 'linux-image-5.4.0-42-generic' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
(base) ~