How to fix dpkg: serious warning: files list file for package 'package' is missing final newline in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 276 views

This error occurs when dpkg metadata files in /var/lib/dpkg/info/ are corrupted, usually due to interrupted installations or disk errors. You can fix it by manually adding the missing newline, deleting the corrupted file, or reconfiguring dpkg.

Quick fix

Fixes dpkg: serious warning: files list file for package 'package' is missing final newline

ls -la /var/lib/dpkg/info/ | grep -E "\.list$"
  1. Locate the corrupted files list
  2. Check if the file is corrupted with binary data
  3. Option 1: Add the missing newline
  4. Option 2: Remove the corrupted .list file
apt โ€” error
ls -la /var/lib/dpkg/info/ | grep -E "\.list$"
dpkg: serious warning: files list file for package 'package' is missing final newline

What this error means

When dpkg encounters a .list file (which tracks files installed by a package) that does not end with a newline character, it issues this warning. The .list files in /var/lib/dpkg/info/ are text files that must follow proper format conventions. This corruption typically occurs when file writes are interrupted during package installation, removals, or upgrades, or when underlying disk or memory errors corrupt the data. The error indicates that dpkg's internal package metadata is malformed, which can prevent proper package management operations.

Typical symptoms

  • apt update or apt upgrade fails with this warning
  • dpkg --configure -a command shows the error
  • Cannot install or remove packages affected by the corrupt .list file
  • Package manager is in a broken state after interrupted operation

Common causes

  1. Installation process interrupted (power loss, manual kill, network interruption)
  2. Underlying disk errors or hardware memory corruption
  3. File system issues or corruption
  4. Abrupt system shutdown during package upgrade

How to fix "dpkg: serious warning: files list file for package 'package' is missing final newline"

1Locate the corrupted files list

Open a terminal and look at the files in /var/lib/dpkg/info/:

bash
ls -la /var/lib/dpkg/info/ | grep -E "\.list$"

Note the package name mentioned in the error message. Look for the corresponding .list file, such as /var/lib/dpkg/info/package-name.list.

2Check if the file is corrupted with binary data

Use cat or hexdump to inspect the file content:

bash
cat /var/lib/dpkg/info/package-name.list | head -20

If you see normal text paths, the file may only be missing the final newline. If you see hex characters or gibberish, the file is corrupted and should be deleted.

3Option 1: Add the missing newline

If the file contains valid text but just lacks a final newline, you can add it:

bash
echo "" >> /var/lib/dpkg/info/package-name.list

This appends a newline to the end of the file, which often resolves the warning.

4Option 2: Remove the corrupted .list file

If the file contains binary garbage or invalid data, delete it and related files:

bash
sudo rm /var/lib/dpkg/info/package-name.list
sudo rm /var/lib/dpkg/info/package-name.md5sums

After removing the file, run:

bash
sudo dpkg --configure -a
5Reconfigure dpkg and update packages

After fixing the corrupted file, reconfigure all packages and update:

bash
sudo dpkg --configure -a
sudo apt update
sudo apt upgrade

The dpkg --configure -a command processes any pending package configurations and should resolve the dpkg state.

6Reinstall the affected package if needed

If the package still has issues after removing its .list file, reinstall it:

bash
sudo apt install --reinstall package-name

This ensures the package metadata is properly recreated.

Advanced notes

This error is often a symptom of underlying hardware issues. If the corruption occurs frequently, your system may have failing RAM or a degrading disk drive. Run hardware diagnostics (memtest86+, fsck) to rule out physical problems. In server environments, check RAID array status if applicable. If files are in a truly unrecoverable state and your system is still broken after these steps, you may need to restore from backups or reinstall your operating system.

Frequently asked questions

What does "dpkg: serious warning: files list file for package 'package' is missin" mean?
list file (which tracks files installed by a package) that does not end with a newline character, it issues this warning. list files in /var/lib/dpkg/info/ are text files that must follow proper format conventions. This corruption typically occurs when file writes are interrupted during package installation, removals, or upgrades, or when underlying disk or memory errors corrupt the data.
How do I fix "dpkg: serious warning: files list file for package 'package' is missin"?
This error occurs when dpkg metadata files in /var/lib/dpkg/info/ are corrupted, usually due to interrupted installations or disk errors. You can fix it by manually adding the missing newline, deleting the corrupted file, or reconfiguring dpkg.
What causes "dpkg: serious warning: files list file for package 'package' is missin"?
Installation process interrupted (power loss, manual kill, network interruption) Underlying disk errors or hardware memory corruption File system issues or corruption
Is the "dpkg: serious warning: files list file for package 'package' is missin" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading