This warning occurs when dpkg cannot find the .list file for an installed package in /var/lib/dpkg/info/. The issue typically happens after interrupted package installations or corrupted package metadata. Reinstalling the affected package or running package repair commands usually resolves it.
The dpkg package manager maintains a database of installed packages in `/var/lib/dpkg/`. For each package, it stores metadata including a `.list` file that contains the complete list of files that package installed on the system. When dpkg encounters a package without its corresponding `.list` file, it issues the warning: "dpkg: warning: files list file for package 'X' missing; assuming package has no files currently installed." This warning indicates: 1. **Metadata corruption**: The package's `.list` file in `/var/lib/dpkg/info/` is missing or inaccessible 2. **Incomplete installation**: A package installation was interrupted before the metadata could be fully written 3. **Database inconsistency**: The dpkg database no longer accurately represents what's installed on the system While the warning doesn't always prevent the package from functioning, it can cause issues with package removal, upgrades, and dependency resolution. The warning typically appears only once when dpkg first encounters the missing file, then reappears if the issue persists.
The simplest solution is to reinstall the affected package, which will recreate the missing .list file:
sudo apt-get install --reinstall package-nameReplace package-name with the actual package name from the warning message. This downloads the package again and reinstalls it, recreating all metadata including the .list file.
If you have multiple packages with this issue, you can reinstall them all at once:
sudo apt-get install --reinstall package1 package2 package3After reinstallation, the warning should disappear completely.
If reinstalling doesn't work or if you have multiple packages affected, try running dpkg repair commands:
# Configure packages that may be partially installed
sudo dpkg --configure -a
# Fix broken dependencies
sudo apt-get install -f
# Clean up and update package cache
sudo apt-get clean
sudo apt-get updateRun these commands in order. They will:
1. Complete any partially configured packages
2. Install missing dependencies or fix broken installations
3. Clear cached package files
4. Refresh the package index
If any of these commands report errors, they'll also suggest which packages to fix next.
If the affected package is not critical and you need a quick fix, you can create an empty .list file:
sudo touch /var/lib/dpkg/info/package-name.listImportant notes:
- This is a temporary workaround, not a proper fix
- The package will be registered as having no files installed
- You may encounter issues when uninstalling the package later
- Use this only if the package is optional or you plan to remove it soon
A proper fix is to reinstall the package afterward:
# Temporary fix
sudo touch /var/lib/dpkg/info/package-name.list
# Then properly fix it by reinstalling
sudo apt-get install --reinstall package-nameIf the package is no longer needed or continues causing problems, remove it completely:
# Remove the package and all configuration files
sudo apt-get purge package-name
# Optionally, remove unnecessary dependencies
sudo apt-get autoremoveThe purge command removes the package and its configuration. The autoremove command removes packages that were installed as dependencies but are no longer needed.
Warning: This deletes the package and its settings. Only use this if you don't need the package anymore.
If dpkg corruption is extensive, you can restore from a backup:
# Check if backup exists
ls -la /var/backups/dpkg*
# Restore from the most recent backup (if available)
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
sudo cp /var/backups/dpkg.diversions.0 /var/lib/dpkg/diversions
sudo cp /var/backups/dpkg.statoverride.0 /var/lib/dpkg/statoverride
# Reconfigure all packages
sudo dpkg --configure -a
# Update and fix dependencies
sudo apt-get update
sudo apt-get install -fdpkg automatically maintains backups of its database in /var/backups/. If you've experienced corruption, restoration can help recover a consistent state.
Caution: This restore operation can change your system state significantly. Only use this if other methods have failed and you understand the implications.
If you have many packages with this issue, use a script to fix them all:
#!/bin/bash
# Find all packages with missing .list files and reinstall them
for package in $(apt list --installed 2>/dev/null | cut -d'/' -f1); do
if [ ! -f /var/lib/dpkg/info/${package}.list ]; then
echo "Fixing: $package"
sudo apt-get install --reinstall $package -y
fi
done
# Run final cleanup
sudo dpkg --configure -a
sudo apt-get install -f
sudo apt-get cleanSave this as fix-dpkg.sh, make it executable (chmod +x fix-dpkg.sh), and run it:
./fix-dpkg.shThis script:
1. Lists all installed packages
2. Checks each one for a missing .list file
3. Reinstalls any that are missing their metadata
4. Runs repair commands to clean up
This approach works well on systems where you don't know which specific packages are affected.
After running repairs, verify that the issue is resolved:
# Check if the warning is gone
sudo apt-get update
# Verify the .list file now exists
ls -la /var/lib/dpkg/info/package-name.list
# Try package operations
sudo apt-get install -s package-name # simulate install
sudo apt-get remove -s package-name # simulate remove- The first command should complete without warnings about missing .list files
- The ls command should show the .list file exists
- The simulate commands (-s flag) should complete without errors
If the warning persists after these steps, check the package name spelling in the warning message and repeat the reinstall for that specific package.
### Understanding dpkg Database Structure
The dpkg database lives in /var/lib/dpkg/ and contains:
- status: Package status database (which packages are installed)
- info/: Directory containing metadata for each package
- package-name.list: File list for the package
- package-name.md5sums: Checksums of installed files
- package-name.conffiles: Configuration files
- diversions, statoverride: Special dpkg instructions
### Filesystem Corruption Detection
If you suspect filesystem corruption rather than simple metadata issues:
# Check filesystem for errors
sudo fsck -n /dev/sdX # Don't actually repair (dry run)
# Check if /var/lib/dpkg is readable
sudo ls -la /var/lib/dpkg/info | head -20
# Verify dpkg database integrity
sudo dpkg --audit### Preventing This Issue
To avoid missing .list file warnings:
1. Avoid interrupting package installations
2. Don't manually delete files from /var/lib/dpkg/info/
3. Keep filesystem free space available (low disk can cause incomplete writes)
4. Use sudo apt-get update && sudo apt-get upgrade -y for regular maintenance
5. Monitor package integrity periodically: sudo debsums -c
### SELinux and AppArmor on Some Systems
On systems with SELinux or AppArmor enabled, ensure dpkg operations aren't restricted:
# Check AppArmor status
sudo aa-status 2>/dev/null | grep dpkg
# Temporarily disable AppArmor for troubleshooting (requires reboot to enable)
sudo systemctl stop apparmor### Large-Scale System Recovery
For production systems with extensive dpkg corruption:
1. Boot into single-user mode or recovery mode
2. Mount filesystem with appropriate permissions
3. Restore from /var/backups/ backups
4. Run dpkg --configure -a and apt-get install -f
5. Reboot and verify with apt-get update && apt-get upgrade
### Differences from Related Errors
This warning is distinct from:
- "Unpacking ... would overwrite ..." (file conflict)
- "E: Sub-process /usr/bin/dpkg returned error code" (dpkg crash)
- "dpkg: error processing package" (metadata corruption during operation)
The "missing .list file" specifically indicates incomplete or missing metadata, not active corruption during an operation.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT