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

aptitudedebianUbuntu

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?

Best Answer

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.

Related Question