How to fix dpkg: error processing archive filename.deb: short read in buffer_copy in APT

APTINTERMEDIATEHIGHUpdated Dec 29, 2025· 208 views

The "short read in buffer_copy" error indicates a corrupted .deb file that dpkg cannot extract. This typically happens due to incomplete downloads, hardware failures, or corrupted package mirrors. Clear your apt cache and re-download the package to resolve the issue.

Quick fix

Fixes dpkg: error processing archive filename.deb: short read in buffer_copy

sudo apt clean
sudo apt update
  1. Clear the apt package cache
  2. Re-attempt the installation with force-depends if needed
  3. Try a different mirror (if cache clear doesn't work)
  4. Check disk health and filesystem integrity
apt — error
sudo apt clean
sudo apt update
dpkg: error processing archive filename.deb: short read in buffer_copy

What this error means

This error occurs when dpkg tries to extract files from a .deb package but encounters corrupted or truncated data. The decompression layer discovers unexpected data, causing the extraction process to end prematurely. Dpkg reports that it did not receive all the data that was announced in the package header—hence the "short read" error. This is essentially dpkg's way of indicating the .deb file itself is damaged or incomplete, rather than an issue with the installation process itself.

Typical symptoms

  • Package installation fails with error message mentioning "short read in buffer_copy"
  • System cannot complete package updates or installations
  • Error occurs during apt upgrade or apt install commands
  • Partial or interrupted downloads may leave corrupted .deb files

Common causes

  1. Incomplete or interrupted package download (network interruption, timeout, or connection drop)
  2. Corrupted package on the mirror server being used
  3. Hardware failure or disk corruption during file transfer or storage
  4. Sudden system shutdown or power failure during package installation
  5. Antivirus software or security tools interfering with file integrity
  6. Corrupted filesystem using delayed allocation (ext4, xfs, btrfs)

How to fix "dpkg: error processing archive filename.deb: short read in buffer_copy"

1Clear the apt package cache

Remove all cached .deb files and fetch fresh copies:

bash
sudo apt clean
sudo apt update

The apt clean command removes all cached package files in /var/cache/apt/archives/, ensuring you get fresh downloads of any corrupted packages.

2Re-attempt the installation with force-depends if needed

Try installing the package again, or use the fix-broken flag:

bash
sudo apt install -f

This will attempt to fix any broken dependencies and re-download packages. If you were installing a specific package:

bash
sudo apt install <package-name>
3Try a different mirror (if cache clear doesn't work)

If the error persists, the mirror server itself may be distributing a corrupted package. Change your apt mirror:

1. Edit /etc/apt/sources.list or relevant .list files in /etc/apt/sources.list.d/
2. Replace the current mirror URL with an alternative one
3. Run sudo apt update again

For Ubuntu users, you can use the mirror selection tool:

bash
sudo software-properties-gtk

Then select a different mirror from the dropdown.

4Check disk health and filesystem integrity

If the error continues across multiple packages, check your storage device:

bash
dmesg | tail -20

Look for hardware errors. If you suspect disk corruption, run a filesystem check (requires root and ideally a non-root partition):

bash
sudo fsck.ext4 -n /dev/sdX  # -n flag does a read-only check

If errors are found, run without -n to fix them (requires unmounting the partition first).

5Verify available disk space

Insufficient disk space can cause failed writes and file corruption:

bash
df -h

Ensure you have at least 100-200 MB free space in /var. If disk space is low, delete unnecessary files or uninstall unneeded packages.

6Temporarily disable antivirus if present

Some antivirus software (like ESET NOD32) can interfere with package integrity checking. If you have antivirus running:

1. Temporarily disable real-time scanning
2. Attempt the package installation again
3. Re-enable the antivirus after completion

If this resolves the issue, configure your antivirus to exclude /var/cache/apt/ and /var/lib/apt/ from scanning.

Advanced notes

This error has been documented since the early dpkg versions (bug #158999 in 2002) and remains common. The error message itself is somewhat misleading—it's actually coming from zlib decompression rather than a true buffer read operation. On systems with filesystems supporting delayed allocation (ext4, xfs, btrfs), sudden power failures during package installation can cause this error. If you frequently encounter this error, it may indicate underlying hardware problems. Monitor dmesg and system logs for correlating hardware errors, especially if multiple packages fail. For CI/CD environments, implement retry logic with cache clearing between attempts, and ensure mirrors are health-checked before directing traffic to them.

Frequently asked questions

What does "dpkg: error processing archive filename.deb: short read in buffer_copy" mean?
deb package but encounters corrupted or truncated data. The decompression layer discovers unexpected data, causing the extraction process to end prematurely. Dpkg reports that it did not receive all the data that was announced in the package header—hence the "short read" error.
How do I fix "dpkg: error processing archive filename.deb: short read in buffer_copy"?
The "short read in buffer_copy" error indicates a corrupted .deb file that dpkg cannot extract. This typically happens due to incomplete downloads, hardware failures, or corrupted package mirrors. Clear your apt cache and re-download the package to resolve the issue.
What causes "dpkg: error processing archive filename.deb: short read in buffer_copy"?
Incomplete or interrupted package download (network interruption, timeout, or connection drop) Corrupted package on the mirror server being used Hardware failure or disk corruption during file transfer or storage
Is the "dpkg: error processing archive filename.deb: short read in buffer_copy" 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