How to fix dpkg-deb: error: archive contains no control file in APT
This error occurs when dpkg-deb encounters a malformed or incomplete Debian package archive that lacks the required control file. Fix it by verifying the DEBIAN directory structure when building packages, or re-downloading corrupted .deb files when installing.
Quick fix
Fixes dpkg-deb: error: archive contains no control file
ls -la my-package/
DEBIAN/
usr/
var/- Verify the DEBIAN directory exists when building packages
- Check that the control file exists in DEBIAN/
- Build the package with dpkg-deb --build
- If installing a corrupted .deb file, delete and re-download it
ls -la my-package/DEBIAN/usr/var/dpkg-deb: error: archive contains no control file
What this error means
The "archive contains no control file" error means dpkg-deb detected that a .deb package archive is missing its control information directory or the control file itself. The control file is essential metadata that describes the package name, version, dependencies, and maintainer information. This error typically occurs in two scenarios: when building a new Debian package from source using dpkg-deb --build, or when trying to install a corrupted or malformed .deb package that was already created.
Typical symptoms
- dpkg-deb -b command fails with the archive contains no control file error
- apt-get install fails when processing a downloaded .deb file
- Package manager cannot read package metadata or dependencies
- Installation fails even though the .deb file exists in /var/cache/apt/archives/
Common causes
- Missing DEBIAN directory (must be uppercase, not debian) when building packages with dpkg-deb --build
- DEBIAN directory exists but lacks a required control file inside it
- Corrupted or incomplete .deb file downloaded from a package repository or third-party source
- Version mismatch between dpkg-deb that built the package and dpkg trying to install it (compression format incompatibility)
- Filesystem corruption or disk errors during package download or storage
How to fix "dpkg-deb: error: archive contains no control file"
If you are building a .deb package from source, ensure your package directory structure includes a DEBIAN subdirectory (case-sensitive, must be uppercase):
ls -la my-package/
DEBIAN/
usr/
var/The DEBIAN directory must contain a control file and other metadata files.
Verify the control file exists and is readable:
ls -la my-package/DEBIAN/
control
postinst
prermIf missing, create a minimal control file with:
Package: my-package
Version: 1.0
Architecture: all
Maintainer: Your Name <you@example.com>
Description: Brief descriptionUse the correct dpkg-deb syntax to create the .deb file:
dpkg-deb --build my-package/
# or explicitly specify output filename
dpkg-deb --build my-package/ my-package.debFor compatibility with older systems, add compression options:
dpkg-deb --build --no-uniform-compression -Zgzip my-package/When the error occurs during installation of a downloaded package, the .deb file may be corrupted:
# Clear the package cache
sudo apt-get clean
# Remove the corrupted .deb from the archives directory
sudo rm /var/cache/apt/archives/package-name*.deb
# Update and reinstall
sudo apt-get update
sudo apt-get install package-nameIf the error occurs when installing a newer .deb package on an older system, the dpkg version may not support the package's compression format:
# Check your dpkg version
dpkg --version
# Update dpkg to the latest version
sudo apt-get update
sudo apt-get install dpkgAlternatively, when building packages, ensure backwards compatibility:
# Build with gzip compression for older systems
dpkg-deb --build --no-uniform-compression -Zgzip my-package/Advanced notes
The dpkg-deb tool supports multiple compression formats: gzip, xz, and none. Starting with dpkg 1.19.0, uniform compression became the default, meaning all members of the archive use the same compression. Older systems with dpkg 1.16.x or 1.17.x may not recognize newer compression formats like xz in the control.tar member, causing the "archive contains no control file" error. If you're packaging for distribution across different Debian/Ubuntu versions, use --no-uniform-compression and -Zgzip for maximum compatibility. The --nocheck option can bypass validation when building (dpkg-deb --build --nocheck), but this is not recommended for production packages as it may mask other structural issues.
Frequently asked questions
- What does "dpkg-deb: error: archive contains no control file" mean?
- deb package archive is missing its control information directory or the control file itself. The control file is essential metadata that describes the package name, version, dependencies, and maintainer information. deb package that was already created.
- How do I fix "dpkg-deb: error: archive contains no control file"?
- This error occurs when dpkg-deb encounters a malformed or incomplete Debian package archive that lacks the required control file. Fix it by verifying the DEBIAN directory structure when building packages, or re-downloading corrupted .deb files when installing.
- What causes "dpkg-deb: error: archive contains no control file"?
- Missing DEBIAN directory (must be uppercase, not debian) when building packages with dpkg-deb --build DEBIAN directory exists but lacks a required control file inside it Corrupted or incomplete .deb file downloaded from a package repository or third-party source
- Is the "dpkg-deb: error: archive contains no control file" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐APT Official Documentation
- ๐Debian dpkg-deb Manual Page(Official Docs)
- ๐Debian Wiki: dpkg(Official Docs)
- ๐Debian Reference Manual: Package Management(Official Docs)
- ๐Ubuntu Wiki: Debugging Installation Issues(Official Docs)