How to fix dpkg-deb: error: archive contains no control file in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 169 views

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/
  1. Verify the DEBIAN directory exists when building packages
  2. Check that the control file exists in DEBIAN/
  3. Build the package with dpkg-deb --build
  4. If installing a corrupted .deb file, delete and re-download it
apt โ€” error
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

  1. Missing DEBIAN directory (must be uppercase, not debian) when building packages with dpkg-deb --build
  2. DEBIAN directory exists but lacks a required control file inside it
  3. Corrupted or incomplete .deb file downloaded from a package repository or third-party source
  4. Version mismatch between dpkg-deb that built the package and dpkg trying to install it (compression format incompatibility)
  5. Filesystem corruption or disk errors during package download or storage

How to fix "dpkg-deb: error: archive contains no control file"

1Verify the DEBIAN directory exists when building packages

If you are building a .deb package from source, ensure your package directory structure includes a DEBIAN subdirectory (case-sensitive, must be uppercase):

bash
ls -la my-package/
DEBIAN/
usr/
var/

The DEBIAN directory must contain a control file and other metadata files.

2Check that the control file exists in DEBIAN/

Verify the control file exists and is readable:

bash
ls -la my-package/DEBIAN/
control
postinst
prerm

If missing, create a minimal control file with:

bash
Package: my-package
Version: 1.0
Architecture: all
Maintainer: Your Name <you@example.com>
Description: Brief description
3Build the package with dpkg-deb --build

Use the correct dpkg-deb syntax to create the .deb file:

bash
dpkg-deb --build my-package/
# or explicitly specify output filename
dpkg-deb --build my-package/ my-package.deb

For compatibility with older systems, add compression options:

bash
dpkg-deb --build --no-uniform-compression -Zgzip my-package/
4If installing a corrupted .deb file, delete and re-download it

When the error occurs during installation of a downloaded package, the .deb file may be corrupted:

bash
# 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-name
5Update dpkg if you encounter version incompatibility

If the error occurs when installing a newer .deb package on an older system, the dpkg version may not support the package's compression format:

bash
# Check your dpkg version
dpkg --version

# Update dpkg to the latest version
sudo apt-get update
sudo apt-get install dpkg

Alternatively, when building packages, ensure backwards compatibility:

bash
# 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