# Apt repo issue "Failed to fetch File has unexpected size"

**URL:** <https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474>\
**Category:** General Questions\
**Created:** [December 28, 2023, 8:22pm UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474 "2023-12-28T20:22:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![radex](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/radex/32/12635_2.png) [@radex](https://forums.percona.com/u/radex)\
**Post date:** [December 28, 2023, 8:22pm UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474/1 "2023-12-28T20:22:02Z")

</div>

Hey,

Looks like something is wrong with debian apt repo. I’m getting the following error when running apt update:

```auto
E: Failed to fetch http://repo.percona.com/apt/dists/bullseye/testing/binary-amd64/Packages.gz File has unexpected size (25355 != 25907). Mirror sync in progress? [IP: 49.12.125.205 80]
   Hashes of expected file:
    - Filesize:25907 [weak]
    - SHA256:cc6dfd1e2297de59994505167cfb0f5356c20c0df3fd2e8d182a02b330d0ff79
    - SHA1:3e9f49855e3a2d5b6c2abd313b7924d6d9c11087 [weak]
    - MD5Sum:614da3bcce3b002e9a037c26d63a9317 [weak]
   Release file created at: Tue, 26 Dec 2023 19:28:47 +0000

```

I’ve tried to clean apt cache, but didn’t help.

Thanks for your support.  
Bartek

---

<div class="post-metadata">

**Author:** ![Nick\_Coppola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nick_coppola/32/5246_2.png) [@Nick\_Coppola](https://forums.percona.com/u/Nick_Coppola)\
**Post date:** [December 28, 2023, 9:33pm UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474/2 "2023-12-28T21:33:53Z")

</div>

I’m also getting a similar error but for the focal distro. Strange thing is that this happens for some of our servers but an apt update works just fine on others, not sure why that’s the case.

> [@Broken apt repo](https://forums.percona.com/t/broken-apt-repo/27471):
>
> I’m getting this error when running apt update on ubuntu 20.04. This started occuring on Tuesday, which seems to line up with the timestamp of ‘Release file created at’ in the error message. Is there an issue with a file that was uploaded to apt for the focal distro? Err:19 http://repo.percona.com/percona/apt focal/main i386 Packages File has unexpected size (20 != 414). Mirror sync in progress? [IP: 147.135.54.159 80] Hashes of expected file: - Filesize:414 [weak] - SHA256:13a18235d6…

---

<div class="post-metadata">

**Author:** ![Nick\_Coppola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nick_coppola/32/5246_2.png) [@Nick\_Coppola](https://forums.percona.com/u/Nick_Coppola)\
**Post date:** [December 29, 2023, 2:28am UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474/3 "2023-12-29T02:28:10Z")

</div>

In my case, I was able to resolve it by switching away from the ‘original’ repo with the percona-release tool

> [@Broken apt repo](https://forums.percona.com/t/broken-apt-repo/27471/2):
>
> After some further digging I found that this error was only happening when the ‘original’ repo was being used with the percona-release tool. Since I only needed proxysql2, I switched it to that repo instead with the following command: percona-release enable-only proxysql

---

<div class="post-metadata">

**Author:** ![Evgeniy\_Patlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/evgeniy_patlan/32/41_2.png) [@Evgeniy\_Patlan](https://forums.percona.com/u/Evgeniy_Patlan)\
**Post date:** [December 29, 2023, 7:12am UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474/4 "2023-12-29T07:12:41Z")

</div>

I tried to reproduce the issue but without success. So I suggest doing the following steps to fix this issues:

1. **Clear the APT Cache** :

- Run `sudo apt-get clean` to clear out the local repository of retrieved package files. It removes everything from `/var/cache/apt/archives/` and `/var/cache/apt/archives/partial/`.

1. **Update the Package Lists** :

- Run `sudo apt-get update` to update the list of available packages and their versions, but it does not install or upgrade any packages.

---

<div class="post-metadata">

**Author:** ![mig5](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mig5/32/1288_2.png) [@mig5](https://forums.percona.com/u/mig5)\
**Post date:** [December 29, 2023, 9:32pm UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474/5 "2023-12-29T21:32:41Z")

</div>

You can see for yourself that [Percona Repo](https://repo.percona.com/apt/dists/focal/main/binary-i386/) the Packages file is 0 bytes (therefore the gzipped file is a gzip of an empty file).

Clearing the cache is not going to help that.

Presumably it is specific to 32-bit as [Percona Repo](https://repo.percona.com/apt/dists/focal/main/binary-amd64/) looks fine.

This needs looking at by the Percona administrators responsible for the apt repository, or at least an official explanation if the issue is that 32-bit is suddenly no longer supported.

---

<div class="post-metadata">

**Author:** ![Evgeniy\_Patlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/evgeniy_patlan/32/41_2.png) [@Evgeniy\_Patlan](https://forums.percona.com/u/Evgeniy_Patlan)\
**Post date:** [May 23, 2024, 11:41pm UTC](https://forums.percona.com/t/apt-repo-issue-failed-to-fetch-file-has-unexpected-size/27474/6 "2024-05-23T23:41:02Z")

</div>

Hey @mig5  
Here you can see that since 2018 Percona doesn’t support 32bit architecture

> **[Percona Software Support Lifecycle Overview](https://www.percona.com/services/policies/percona-software-support-lifecycle)**
>
> This document is intended to clarify the impact of the Percona Release Lifecycle Overview and the Percona Services Lifecycle Policy on software which Percona produces and the Linux-based operating system platforms which we provide services and...
