How to fix dpkg: serious warning: files list file for package 'package' is missing final newline in APT
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$"- Locate the corrupted files list
- Check if the file is corrupted with binary data
- Option 1: Add the missing newline
- Option 2: Remove the corrupted .list file
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
- Installation process interrupted (power loss, manual kill, network interruption)
- Underlying disk errors or hardware memory corruption
- File system issues or corruption
- Abrupt system shutdown during package upgrade
How to fix "dpkg: serious warning: files list file for package 'package' is missing final newline"
Open a terminal and look at the files in /var/lib/dpkg/info/:
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.
Use cat or hexdump to inspect the file content:
cat /var/lib/dpkg/info/package-name.list | head -20If 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.
If the file contains valid text but just lacks a final newline, you can add it:
echo "" >> /var/lib/dpkg/info/package-name.listThis appends a newline to the end of the file, which often resolves the warning.
If the file contains binary garbage or invalid data, delete it and related files:
sudo rm /var/lib/dpkg/info/package-name.list
sudo rm /var/lib/dpkg/info/package-name.md5sumsAfter removing the file, run:
sudo dpkg --configure -aAfter fixing the corrupted file, reconfigure all packages and update:
sudo dpkg --configure -a
sudo apt update
sudo apt upgradeThe dpkg --configure -a command processes any pending package configurations and should resolve the dpkg state.
If the package still has issues after removing its .list file, reinstall it:
sudo apt install --reinstall package-nameThis 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
- ๐APT Official Documentation
- ๐
- ๐
- ๐dpkg(1) man page - Official dpkg manual(Official Docs)