From 1ba562f400e30884135d6b1ddd898dad39b18a12 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Tue, 7 Apr 2026 17:58:14 -0700 Subject: [PATCH] ci(deb): use AWS regional mirror for apt in deb build container The default archive.ubuntu.com round-robin can serve out-of-sync index files mid-sync, which makes apt-get update fail with 'File has unexpected size' errors and breaks the deb build job for everyone until the upstream mirror catches up. Rewrite the container's apt sources to point at us-west-2.ec2.archive. ubuntu.com instead. The EC2 archive mirrors are Canonical-operated, region-local to the runs-on instances, and sync aggressively, eliminating the round-robin lottery as a CI failure mode. Signed-off-by: Ramon Roche --- .github/workflows/build_deb_package.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build_deb_package.yml b/.github/workflows/build_deb_package.yml index 79664648ab..04d43f7224 100644 --- a/.github/workflows/build_deb_package.yml +++ b/.github/workflows/build_deb_package.yml @@ -90,6 +90,17 @@ jobs: - name: Fix git in container run: | + # Switch to AWS regional mirrors. runs-on instances are in us-west-2, + # and the EC2 archive mirrors are Canonical-operated, region-local, + # and sync aggressively. The default archive.ubuntu.com round-robin + # sometimes serves out-of-sync index files mid-sync, breaking + # apt-get update. + if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then + sed -i 's|http://archive.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list.d/ubuntu.sources + fi + if [ -f /etc/apt/sources.list ]; then + sed -i 's|http://archive.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list + fi apt-get update && apt-get install -y git git config --global --add safe.directory $(realpath .)