Apt update failing on AWS us-east-1 instances

I’m seeing the following error when running apt update on us-east-1 instances in AWS:

E: Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/dists/noble-updates/universe/binary-amd64/Packages.xz  File has unexpected size (1568696 != 1568516). Mirror sync in progress? [IP: 18.232.150.247 80]

It seems like the problem started this morning. I am able to work around it by replacing the default mirror (e.g. via sed -i 's/http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu\//http:\/\/mirror.cogentco.com\/pub\/linux\/ubuntu\//g' /etc/apt/sources.list.d/ubuntu.sources).

This also happened a couple of months ago, starting on Saturday 21Mar, and wasn’t resolved until people returned to the office the following Monday. The status page at https://status.canonical.com/ doesn’t show any incidents today. Is there any way to flag this for the folks responsible for maintaining the AWS mirrors?

sudo rm -rf /var/lib/apt/lists/* && sudo apt-get clean && sudo apt-get update

Should do it

This error is showing up on brand new instances - I don’t think there’s an apt cache to clear.

Have you logged a ticket to the AWS support? You are using their repo

Hm, that is an idea - I thought Ubuntu maintained the AWS mirrors since status.canonical.com lists other cloud mirrors but maybe it’s actually AWS maintaining them.

This topic was automatically closed after 30 days. New replies are no longer allowed.