APT cannot read or parse package list files, preventing installations and updates. This happens when cache files become corrupted during failed downloads or system interruptions. Rebuild the package cache by removing corrupted files.
This error occurs when APT is unable to read or comprehend files in the /var/lib/apt/lists directory, which contains package information from your configured repositories. The parsing failure prevents package installation and updates from proceeding. The error typically references a specific file (like archive.ubuntu.com_ubuntu_dists_bionic_InRelease) that APT cannot process. This corruption can happen during interrupted downloads, power outages, network instability, or filesystem errors.
Look at the error output to see which specific file cannot be parsed, for example:
E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease
Note the filename - you may need to remove just that file or clear all cached files.
If multiple files are corrupted or you want to do a complete rebuild, remove all cached package lists:
sudo rm -rf /var/lib/apt/lists/*If only one file is corrupted (based on the error message), remove just that file:
sudo rm /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InReleaseRun the update command to rebuild the package lists:
sudo apt updateAPT will re-download all package information from your configured repositories. This may take a few minutes depending on your internet speed.
After the update completes successfully, you can proceed with installations and upgrades:
sudo apt upgradeIf the error still occurs, it may be related to a specific repository. Check your sources.list:
sudo nano /etc/apt/sources.listRemove or comment out (with #) any suspicious or third-party repositories.
If the error persists after clearing /var/lib/apt/lists, the issue may involve /var/lib/dpkg/status corruption. Restore from backup:
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
For permission issues:
sudo chown -R root:root /var/lib/apt/lists
sudo chmod -R 755 /var/lib/apt/lists
Check APT logs at /var/log/apt/ and /var/log/dpkg.log for detailed error information. On systems using xz compression (older releases), compression format incompatibility can cause parsing errors - upgrading APT may be necessary.
Note: Do not delete the /var/lib/apt/lists directory itself, only its contents. If accidentally deleted, recreate it with: sudo mkdir -pv /var/lib/apt/lists/partial
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
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