APT proxy metadata problems

“apt update” command returns error:

E: Failed to fetch http://XXXXXXXXX/repository/apt-download-docker-proxy/dists/bionic/nightly/binary-amd64/Packages.gz File has unexpected size (71462 != 71267). Mirror sync in progress?

It happens occasionally on different proxied repositories.

I have the same issue. So far I’ve only had this when using my Nexus apt proxies on Desktop Ubuntu installations. This error never happens on the server edition.

I have added the exact same entries in /etc/apt/sources.list in the server and desktop editions of Ubuntu Bionic, Focal and Jammy. Every single time the server edition works, the desktop won’t.

I think it is related to downloading/generating images (icons) for the software manager in the desktop version, but I’m not sure. That is where my debugging skills end.

1 Like

I have the same issue.
https://FQDN/repository/ubuntu-focal/dists/focal-security/main/binary-i386/Packages.xz File has unexpected size (479908 != 480080). Mirror sync in progress?
I test my local ubuntu mirror and compare with "https://archive.ubuntu.com/ubuntu/dists/focal-security/"
Files Packages.xz and InRelease in local mirror are the same as in http://archive.ubuntu.com/ubuntu/dists/focal-security/ with size 479908
Packages.xz in nexus cache is the same like in http://archive.ubuntu.com/ubuntu/dists/focal-security/ and local mirror too.
But InRelease in nexus cache is older then in local and remote mirrors. And the size of Packages.xz in that file is equal 480080.
Only manual (or via general rest api) “clear cache” and “invalidate index” helps to fix that problem .
Are there any ideas how to fix that problem?
Repo apt proxy

1 Like

For me it helps if I manually delete metadata directory from repo and let it cache again. But this is not a proper solution.

1 Like

Metadata file size on nexus does not match metadata file on remote url, even if I delete locally cached metadata files and redownload them:



Remote url: Index of /ubuntu/dists/jammy/by-hash/SHA256

Looks like the remote is returning the transfer size which is gzipped.

You can verify this by downloading one of the files with a web browser.