From 1d46401b070270cb3185201465c208b70f678fc0 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 4 Aug 2026 07:52:24 +0800 Subject: [PATCH] CI: Use main Ubuntu archive instead of azure.archive.ubuntu.com The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners regularly degrades to trickle speeds for extended periods, stalling package downloads until the job hits its timeout. This is a recurring upstream problem, see actions/runner-images issues #7048 and #12949. apt retries do not help because the connection stays alive, only slow. Switch affected jobs to archive.ubuntu.com, which is consistently fast from Azure. --- .github/scripts/install-deps.sh | 2 ++ .github/scripts/use-main-ubuntu-mirror.sh | 15 +++++++++++++++ .github/workflows/ci.yml | 1 + 3 files changed, 18 insertions(+) create mode 100755 .github/scripts/use-main-ubuntu-mirror.sh diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh index dee1d5084b3..174c7a9558e 100755 --- a/.github/scripts/install-deps.sh +++ b/.github/scripts/install-deps.sh @@ -3,6 +3,8 @@ set -eu #Needed so CI fails when anything is wrong set -x +.github/scripts/use-main-ubuntu-mirror.sh + sudo apt-get --quiet update sudo apt-get install --yes --no-install-recommends devscripts equivs build-essential lintian clang debian/configure diff --git a/.github/scripts/use-main-ubuntu-mirror.sh b/.github/scripts/use-main-ubuntu-mirror.sh new file mode 100755 index 00000000000..8a5d12efbaa --- /dev/null +++ b/.github/scripts/use-main-ubuntu-mirror.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners +# regularly degrades to trickle speeds for extended periods, which stalls +# package downloads until the job hits its timeout. apt retries do not +# help because the connection stays alive, only slow. Switch to the main +# Ubuntu archive, which is consistently fast from Azure. + +set -eu #Needed so CI fails when anything is wrong +set -x + +for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do + [ -e "$f" ] || continue + sudo sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' "$f" +done diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6035eb6289c..c1d9c9a1430 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,6 +131,7 @@ jobs: - name: Install dependencies run: | set -x + .github/scripts/use-main-ubuntu-mirror.sh sudo apt-get -q update sudo apt-get --yes install cppcheck - name: Cppcheck