What causes "Failed to fetch ... File has unexpected size. Mirror sync progress?" error?

25,484

Solution 1

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

Software & Update

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.

Share:
25,484

Related videos on Youtube

frownyface
Author by

frownyface

Updated on September 18, 2022

Comments

  • frownyface
    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
    frownyface over 4 years
    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?
  • K7AAY
    K7AAY over 4 years
    Why not? Because Linux users download too much. Having multiple minors scattered all over the planet means folks get their downloads quicker.
  • frownyface
    frownyface over 4 years
    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?
  • K7AAY
    K7AAY over 4 years
    For data integrity.
  • Zimo
    Zimo almost 3 years
    Thank you. You saved me hours of troubleshooting
  • davidbaumann
    davidbaumann over 2 years
    This is dangerous. Also there is no sufficient explanation what this option does.
  • Manyam Nandeesh Reddy
    Manyam Nandeesh Reddy over 2 years
    Updated the resolution, please check.