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.
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.
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.
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.
E: Cannot set to hold: package 'package-name' is not installed
How to fix "Cannot set to hold" error when package is not installed in APT
debconf: unable to initialize frontend: Dialog
How to fix "debconf: unable to initialize frontend: Dialog" in APT
E: Could not connect to proxy server
Could not connect to proxy server
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt