1

I tried to install some package updates on my Ubuntu 20.04.5, but everything fails with:

dpkg: unrecoverable fatal error, aborting:
 files list file for package 'linux-image-5.4.0-42-generic' is missing final newline

How would I resolve this?

Here is the example I tried:

> 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)  ~

4
  • What is Ubuntu 22. There are 3 different versions that could be. Ubuntu Core 22, Ubuntu 22.04 and Ubuntu 22.10 You need an accurate version number in your question.
    – David
    Oct 19, 2022 at 13:19
  • David, it's 20.04.5, updated the question.
    – Danijel
    Oct 19, 2022 at 13:20
  • Have you tried to just reinstall the kernel package that it is asking for? sudo apt install --reinstall linux-image-5.4.0-42-generic
    – Terrance
    Oct 19, 2022 at 14:07
  • Yes, I tried, but got the same error.
    – Danijel
    Oct 19, 2022 at 14:24

0

You must log in to answer this question.

Browse other questions tagged .