How to fix W: Size of file is not what the server reported in APT
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- Clean the apt cache
- Wait and retry if the mirror is syncing
- Rebuild package lists completely
- Update apt to the latest version
sudo apt-get cleansudo apt-get updateW: 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
- 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
- Intermittent network issues during download causing partial file transfer
- Repository server temporarily reporting incorrect file sizes
How to fix "W: Size of file is not what the server reported"
Remove cached package lists and index files to force a fresh download:
sudo apt-get clean
sudo apt-get updateThe apt-get clean command removes all cached .deb files from /var/cache/apt/archives/. The apt-get update redownloads the latest package metadata.
If the warning persists after step 1, the repository mirror may be mid-synchronization. Wait a few minutes and try again:
sudo apt-get updateMost mirrors complete sync operations quickly. A second attempt usually succeeds once sync finishes.
If the warning still appears, rebuild the package lists from scratch:
sudo rm -rf /var/lib/apt/lists/*
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get updateThis removes all cached lists and forces apt to re-download metadata for all configured repositories.
If you are on an older system (Ubuntu 12.04 or earlier, Debian Wheezy), update apt and apt-transport-https to get bug fixes:
sudo apt-get install --only-upgrade apt apt-transport-https
sudo apt-get updateVersions 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
- 📚APT Official Documentation
- 📖Debian Bug Report #802617(Official Docs)
- 📖Ubuntu Launchpad Bug #815895(Official Docs)