How to fix dpkg-deb: error: failed to read archive in APT
The "failed to read archive" error occurs when dpkg-deb cannot parse a .deb package file, usually due to corruption, an incomplete download, or an unsupported compression format. This guide covers diagnosis and repair strategies.
Quick fix
Fixes dpkg-deb: error: failed to read archive
rm ~/path/to/package.deb
wget https://example.com/package.deb- Re-download the package
- Clear the apt cache
- Update dpkg to the latest version
- Reconfigure the dpkg database
rm ~/path/to/package.debwget https://example.com/package.debdpkg-deb: error: failed to read archive
What this error means
When dpkg-deb encounters a .deb archive that does not conform to the Debian package format, it cannot extract the control files and payload. This error means the file header is invalid, the file is corrupted, or the compression method is not supported by your dpkg version. The dpkg package manager relies on these archives to install software, so a malformed archive blocks installation entirely.
Typical symptoms
- Package installation fails with "dpkg-deb: error: failed to read archive" message
- apt install or dpkg -i commands cannot proceed
- The error appears when installing .deb files downloaded from the internet
- System cannot complete package configuration during installation
Common causes
- Corrupted or incomplete .deb file download due to network interruption
- Outdated dpkg version that does not support newer compression formats (e.g., zstd)
- File is not actually a valid Debian package despite .deb extension
- Disk I/O errors or hardware issues corrupting the file
- Cached corrupted package in /var/cache/apt/archives/
- Interrupted installation process leaving partial or invalid files
How to fix "dpkg-deb: error: failed to read archive"
The most common cause is a failed or corrupted download. Remove the problematic file and download it again from the official repository or source:
rm ~/path/to/package.deb
wget https://example.com/package.debVerify the file is not empty or truncated:
file package.debA valid .deb file should show as "Debian binary package".
If the package was downloaded via apt, cached corrupted versions may persist. Clear the entire cache:
sudo apt cleanOr remove only the problematic package:
sudo rm /var/cache/apt/archives/package-name*.debThen retry the installation.
Older dpkg versions do not support modern compression formats. Update to ensure compatibility:
sudo apt update
sudo apt install --only-upgrade dpkgIf you are blocked from apt, download dpkg manually from your distribution's repository and install with: sudo dpkg -i dpkg*.deb
If the installation was interrupted mid-way, the dpkg database may be in an inconsistent state. Reconfigure all packages:
sudo dpkg --configure -aThis command tells dpkg to finish configuring any partially installed packages.
After reconfiguring, resolve any lingering dependency issues:
sudo apt install -fThis command installs or removes packages to satisfy dependencies.
If the error persists across multiple packages, your storage device may have hardware issues. Check system logs for I/O errors:
sudo dmesg | tail -20Look for messages about read/write errors or timeout. If found, run a file system check on the next reboot:
sudo fsck -n /dev/sdX(Replace sdX with your device; use -n to preview without making changes)
As a last resort, if you are certain the package is safe, attempt installation with the --force-overwrite flag:
sudo dpkg -i --force-overwrite package.debUse this only if you trust the package source and have no other options.
Advanced notes
For advanced users: if dpkg-deb shows specific errors like "archive uses unknown compression for member 'control.tar.zst'", this indicates your dpkg version is too old to handle zstd-compressed packages. Ensure you are on the latest stable release of your distribution. On systems where apt itself is broken, you may need to manually download and install dpkg first, then proceed with other packages. For developers creating .deb packages, ensure the archive structure is correct: control.tar.{gz,xz,zst} must precede data.tar.{gz,xz,zst}, and both must be preceded by the debian-binary file.
Frequently asked questions
- What does "dpkg-deb: error: failed to read archive" mean?
- deb archive that does not conform to the Debian package format, it cannot extract the control files and payload. This error means the file header is invalid, the file is corrupted, or the compression method is not supported by your dpkg version. The dpkg package manager relies on these archives to install software, so a malformed archive blocks installation entirely.
- How do I fix "dpkg-deb: error: failed to read archive"?
- The "failed to read archive" error occurs when dpkg-deb cannot parse a .deb package file, usually due to corruption, an incomplete download, or an unsupported compression format. This guide covers diagnosis and repair strategies.
- What causes "dpkg-deb: error: failed to read archive"?
- Corrupted or incomplete .deb file download due to network interruption Outdated dpkg version that does not support newer compression formats (e.g., zstd) File is not actually a valid Debian package despite .deb extension
- Is the "dpkg-deb: error: failed to read archive" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐APT Official Documentation
- ๐Ubuntu Debugging Installation Issues(Official Docs)
- ๐
- ๐ฌLinux Mint Forum Discussion(Stack Overflow)