Q: How to fix apt-get update error Mirror sync in progress?

23,108

Solution 1

Well, you may have actually hit it while the remote mirror was synching... in which case, waiting an hour or so, running apt-get clean (or apt clean) and then re-running the original apt-get update (or apt update).

If the error persists, you may want to notify the mirror provider if you can find a contact address, and then simply point your sources.list to a different mirror.

Solution 2

Helping a student university which was trying to run a simple apt-get update on an ubuntu docker container running on MacOS which was facing the same issue I ended up later finding that this issue was caused by "Screen Time", which is a MacOS Parental Control system, which apparently was blocking "certain" requests to the ubuntu repositories but not all.

Since the "firewall" had some restrictions for "adult sites", at some point when it was trying to fetch a hash from the repo, it would get a "blocked" HTML response from Screen Time on the host. This was especially interesting to me since I didn't think with the whole MacOS VM-based Docker subsystem, the HTTP networking within the container within the VM was subject to control by the host system :\

Solution 3

If you are using MacOS to run this virtual machine, the solution to this problem is going to "Screen Time" setting and change the settings to "Unrestricted web access".

Share:
23,108

Related videos on Youtube

udnpico
Author by

udnpico

Updated on September 18, 2022

Comments

  • udnpico
    udnpico over 1 year

    I have difficulties when install postgresql-client.9.4 on debian 10.

    printf "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list
    
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
    
    apt-get update && apt-get install -y -qq postgresql-client-9.4
    

    result

    oot@8854c7bad7ae:/# apt-get update
    Hit:1 http://security-cdn.debian.org/debian-security buster/updates InRelease
    Hit:2 http://cdn-fastly.deb.debian.org/debian buster InRelease
    Hit:3 http://cdn-fastly.deb.debian.org/debian buster-updates InRelease
    Get:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease [46.2 kB]
    Get:5 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 Packages [138 kB]
    Err:5 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 Packages
      File has unexpected size (137678 != 138126). Mirror sync in progress? [IP: 87.238.57.227 80]
      Hashes of expected file:
       - Filesize:138126 [weak]
       - SHA256:8a5dec4b72ef7e16bb0336a385f5072cb4092d5a935ada6095b5c971a9d3420a
       - SHA1:9d30afef3e3590e5adadabd04845fd547f5f88f7 [weak]
       - MD5Sum:ed36fcbcb7d390b2772bc81a12cf786b [weak]
      Release file created at: Mon, 23 Sep 2019 14:11:10 +0000
    Fetched 46.2 kB in 3s (15.7 kB/s)
    

    How to fix this error?

  • The Unknown Dev
    The Unknown Dev about 3 years
    Yes, this was the problem for me. I went to System Preferences > Screen Time and toggled to Web Content: Unrestricted Access.