How to fix W: Size of file is not what the server reported in APT

APTBEGINNERLOWUpdated Dec 29, 2025· 295 views

This warning appears when apt detects a mismatch between the file size the server claims to send and the size recorded in the Release metadata. Usually harmless, it results from cached data or mirror synchronization delays and resolves by cleaning the apt cache and retrying.

Quick fix

Fixes W: Size of file is not what the server reported

sudo apt-get clean
sudo apt-get update
  1. Clean the apt cache
  2. Wait and retry if the mirror is syncing
  3. Rebuild package lists completely
  4. Update apt to the latest version
apt — error
sudo apt-get clean
sudo apt-get update
W: Size of file is not what the server reported

What this error means

When you run `apt-get update`, apt downloads package metadata from repositories. Each file has an expected size recorded in the Release file. This warning occurs when the actual bytes received do not match the expected size, typically due to the https transport reporting stale values or mirrors being mid-sync. The verification process still succeeds because apt compares checksums, not just sizes. This warning is primarily informational and does not prevent package installation.

Typical symptoms

  • Warning message "W: Size of file is not what the server reported" appears during apt-get update
  • Package updates seem to complete despite the warning
  • The warning disappears on subsequent update attempts
  • Affects repositories accessed over HTTPS, especially custom or third-party repos

Common causes

  1. Mirror is mid-synchronization and has incomplete or stale metadata
  2. Cached metadata in /var/lib/apt/lists is outdated or corrupted
  3. apt-transport-https bug (pre-1.1 versions) reuses stale size values when falling back from InRelease to Release
  4. Intermittent network issues during download causing partial file transfer
  5. Repository server temporarily reporting incorrect file sizes

How to fix "W: Size of file is not what the server reported"

1Clean the apt cache

Remove cached package lists and index files to force a fresh download:

bash
sudo apt-get clean
sudo apt-get update

The apt-get clean command removes all cached .deb files from /var/cache/apt/archives/. The apt-get update redownloads the latest package metadata.

2Wait and retry if the mirror is syncing

If the warning persists after step 1, the repository mirror may be mid-synchronization. Wait a few minutes and try again:

bash
sudo apt-get update

Most mirrors complete sync operations quickly. A second attempt usually succeeds once sync finishes.

3Rebuild package lists completely

If the warning still appears, rebuild the package lists from scratch:

bash
sudo rm -rf /var/lib/apt/lists/*
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update

This removes all cached lists and forces apt to re-download metadata for all configured repositories.

4Update apt to the latest version

If you are on an older system (Ubuntu 12.04 or earlier, Debian Wheezy), update apt and apt-transport-https to get bug fixes:

bash
sudo apt-get install --only-upgrade apt apt-transport-https
sudo apt-get update

Versions 1.1 and later fixed the https transport reporting issue that caused this warning.

Advanced notes

This warning was most common in apt versions prior to 1.1 due to a bug in apt-transport-https where the https method reused a global struct for reporting size mismatches. When the InRelease file was unavailable and the fallback to Release occurred, stale size values would be reported. Modern versions of apt actively validate file sizes match expectations and reject oversized downloads, making this warning obsolete in newer distributions. For custom or self-hosted repositories, ensure your release signing and metadata generation is correct—the issue may indicate problems on the server side.

Frequently asked questions

What does "W: Size of file is not what the server reported" mean?
When you run apt-get update, apt downloads package metadata from repositories. Each file has an expected size recorded in the Release file. This warning occurs when the actual bytes received do not match the expected size, typically due to the https transport reporting stale values or mirrors being mid-sync.
How do I fix "W: Size of file is not what the server reported"?
This warning appears when apt detects a mismatch between the file size the server claims to send and the size recorded in the Release metadata. Usually harmless, it results from cached data or mirror synchronization delays and resolves by cleaning the apt cache and retrying.
What causes "W: Size of file is not what the server reported"?
Mirror is mid-synchronization and has incomplete or stale metadata Cached metadata in /var/lib/apt/lists is outdated or corrupted apt-transport-https bug (pre-1.1 versions) reuses stale size values when falling back from InRelease to Release
Is the "W: Size of file is not what the server reported" error serious?
It is a low-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading