What causes "Failed to fetch ... File has unexpected size. Mirror sync progress?" error?
Solution 1
Open Software & Updates and change Download from to Main Server as said in the link shared by @K7AAY
Solution 2
Take a look at the official list of Ubuntu mirrors.
See the ones in red? Those are not up to date. They will get up to date, eventually, by syncing with the master repository. When that's underway, file sizes won't match the master file size, and errors like this will occur.
Solution: Use another mirror. How do I change my update server in Ubuntu 18.04? shows how.
Related videos on Youtube
frownyface
Updated on September 18, 2022Comments
-
frownyface almost 2 years
I've seen this error pop up for different people for different repositories. I was just curious what is the exact this error, as I got it the other day. I think I ran "sudo apt update."
E: Failed to fetch https://download.docker.com/linux/ubuntu/dists/bionic/stable/binary-amd64/Packages.bz2 File has unexpected size (9051 != 9594). Mirror sync in progress?
From my impression, it is something that happens when the package containers mess up with something.
-
frownyface over 4 yearsI'm still having trouble fully understanding. If i'm downloading a package from a mirror, does ubuntu check if the file size of the mirror and master match? At that point, why have mirrors and not just get the package directly from the master?
-
K7AAY over 4 yearsWhy not? Because Linux users download too much. Having multiple minors scattered all over the planet means folks get their downloads quicker.
-
frownyface over 4 yearsI see, I guess I was confused because I thought it would be more efficient for the package download process to not compare the mirror file size to the master file size. Because I thought at that point just download the package from master. But it makes sense cus it’s saving the process of downloading from mast. So is the comparison for security reasons?
-
K7AAY over 4 yearsFor data integrity.
-
Zimo almost 3 yearsThank you. You saved me hours of troubleshooting
-
davidbaumann over 2 yearsThis is dangerous. Also there is no sufficient explanation what this option does.
-
Manyam Nandeesh Reddy over 2 yearsUpdated the resolution, please check.