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.
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.
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.
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.
E: Sub-process /usr/bin/dpkg returned an error code (2)
How to fix "Sub-process /usr/bin/dpkg returned an error code (2)" in APT
dpkg-divert: error: rename involves overwriting 'path' with different file
How to fix dpkg-divert rename conflicts in APT
E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation
How to fix "dpkg returned an error code (1)" in APT kernel installation
dpkg: dependency problems prevent configuration of triggers
dpkg: dependency problems prevent configuration of triggers in apt
dpkg: unrecoverable fatal error, aborting
How to fix "dpkg: unrecoverable fatal error, aborting" in APT