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.

3 Answers 3


Open Software & Updates and change Download from to Main Server as said in the link shared by @K7AAY

Software & Update

  • 1
    Thank you. You saved me hours of troubleshooting
    – Zimo
    Aug 12, 2021 at 3:20

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.

  • I'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?
    – frownyface
    Oct 26, 2019 at 18:59
  • 1
    Why not? Because Linux users download too much. Having multiple minors scattered all over the planet means folks get their downloads quicker.
    – K7AAY
    Oct 27, 2019 at 22:45
  • I 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?
    – frownyface
    Oct 27, 2019 at 23:16
  • For data integrity.
    – K7AAY
    Dec 8, 2019 at 20:22

Update the /etc/apt/sources.list with one of the mirror links below and comment on the previous repository link until the mirror sync is completed.


Eg: For Ubuntu 18.04 Version you can update your /etc/apt/sources.list with the below lines

deb http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu/ bionic main 
deb-src http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu/ bionic main 
  • This is dangerous. Also there is no sufficient explanation what this option does. Feb 24, 2022 at 10:15
  • 1
    Updated the resolution, please check. Mar 12, 2022 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.