无法安装任何软件包:“软件包 linux-image-5.4.0-42-generic 缺少最后的换行符”?

无法安装任何软件包:“软件包 linux-image-5.4.0-42-generic 缺少最后的换行符”?

我尝试在我的 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)  ~

相关内容