How to fix dpkg: serious warning: files list file for package 'package-name' contains empty filename in APT
The dpkg package manager encountered a corrupted .list file in /var/lib/dpkg/info/ that contains an empty filename. This prevents apt from functioning and requires manual repair of the corrupted package metadata.
Quick fix
Fixes dpkg: serious warning: files list file for package 'package-name' contains empty filename
dpkg: serious warning: files list file for package 'package-name' contains empty filename- Identify the corrupted package
- Verify the corrupted .list file
- Delete the corrupted .list file
- Reinstall the affected package
dpkg: serious warning: files list file for package 'package-name' contains empty filenamedpkg: serious warning: files list file for package 'package-name' contains empty filename
What this error means
This error occurs when dpkg's internal package metadata becomes corrupted. Each installed package has a .list file in /var/lib/dpkg/info/ that tracks which files belong to that package. When this file becomes damaged—either through disk errors, interrupted operations, or memory problems—dpkg cannot parse it and refuses to continue operations. The error indicates the .list file has an invalid entry with no filename, which breaks dpkg's file inventory tracking. This is a serious issue because dpkg cannot determine which files are owned by the corrupted package, making the package manager unstable and blocking all package operations including upgrades and new installations.
Typical symptoms
- apt-get, apt, or other package manager commands fail or hang
- Cannot upgrade packages or install new ones
- Warning appears mentioning a specific package name in /var/lib/dpkg/info/
- System shows 'sub-process /usr/bin/dpkg returned an error'
- Multiple packages report the same error with weird hex characters in .list files
Common causes
- Disk I/O errors or bad blocks on the storage device causing file corruption
- Power loss or system crash during package installation or upgrade
- Process interrupted during dpkg unpack or configuration stage
- Corrupted download during package installation
- Memory errors preventing proper file write operations
How to fix "dpkg: serious warning: files list file for package 'package-name' contains empty filename"
The error message will tell you which package is corrupted. Extract the package name from the error:
dpkg: serious warning: files list file for package 'package-name' contains empty filenameIn this example, the corrupted package is package-name.
Check the actual contents of the corrupted .list file to confirm corruption:
sudo cat /var/lib/dpkg/info/package-name.listIf it shows weird hex characters instead of clear text (filenames), the file is corrupted and should be deleted. If it's empty, deletion is safe.
Remove the corrupted metadata file. This is safe because dpkg can regenerate it:
sudo rm /var/lib/dpkg/info/package-name.listReplace package-name with the actual package name from the error message.
Reinstalling the package will regenerate the .list file:
sudo apt-get install --reinstall package-nameThis downloads the package again and reinstalls it, creating a fresh .list file with correct metadata.
If multiple packages show the same error, repeat steps 1-4 for each one. For efficiency, create a script:
# Extract package names from error output and save to a file
# Then reinstall them in sequence
for pkg in package1 package2 package3; do
sudo rm /var/lib/dpkg/info/$pkg.list
sudo apt-get install --reinstall $pkg -y
doneThis will iterate through all corrupted packages and repair them automatically.
After repairs, verify dpkg can operate normally:
# Check for any remaining warnings
sudo apt-get check
# Try a safe operation
sudo apt-get update
# Attempt an upgrade
sudo apt-get upgradeIf these commands succeed without dpkg warnings, the corruption has been resolved.
Advanced notes
If you continue to see similar errors after repair, it may indicate underlying disk problems. Run a filesystem check to detect bad sectors:
# Check disk for errors (requires reboot for root filesystem)
sudo fsck -n /dev/sdX
# View system messages for I/O errors
sudo dmesg | grep -i "error|fail"If the disk shows errors, back up your data immediately and plan for disk replacement. Another approach is to use dpkg with force options to skip the problematic packages temporarily:
# Configure all packages (may skip broken ones)
sudo dpkg --configure -a
# Force skip the corrupted package
sudo dpkg --force-all -r package-nameHowever, this should only be a last resort before full disk analysis. The preferred solution is always to repair via reinstallation as described above.
Frequently asked questions
- What does "dpkg: serious warning: files list file for package 'package-name' cont" mean?
- This error occurs when dpkg's internal package metadata becomes corrupted. list file in /var/lib/dpkg/info/ that tracks which files belong to that package. When this file becomes damaged—either through disk errors, interrupted operations, or memory problems—dpkg cannot parse it and refuses to continue operations.
- How do I fix "dpkg: serious warning: files list file for package 'package-name' cont"?
- The dpkg package manager encountered a corrupted .list file in /var/lib/dpkg/info/ that contains an empty filename. This prevents apt from functioning and requires manual repair of the corrupted package metadata.
- What causes "dpkg: serious warning: files list file for package 'package-name' cont"?
- Disk I/O errors or bad blocks on the storage device causing file corruption Power loss or system crash during package installation or upgrade Process interrupted during dpkg unpack or configuration stage
- Is the "dpkg: serious warning: files list file for package 'package-name' cont" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.