diff --git a/.github/workflows/scripts/qemu-1-setup.sh b/.github/workflows/scripts/qemu-1-setup.sh index 0278264d9279..a597e3462f04 100755 --- a/.github/workflows/scripts/qemu-1-setup.sh +++ b/.github/workflows/scripts/qemu-1-setup.sh @@ -13,6 +13,20 @@ set -eu # handle on what the timeout value should be. (while [ 1 ] ; do sleep 30 && echo "[watchdog: $(ps -eo cmd --sort=-pcpu | head -n 2 | tail -n 1)}')]"; done) & +# The default 'azure.archive.ubuntu.com' mirrors can be really slow. +# Prioritize the official Ubuntu mirrors. +# +# The normal apt-mirrors.txt will look like: +# +# http://azure.archive.ubuntu.com/ubuntu/ priority:1 +# https://archive.ubuntu.com/ubuntu/ priority:2 +# https://security.ubuntu.com/ubuntu/ priority:3 +# +# Just delete the 'azure.archive.ubuntu.com' line. +sudo sed -i '/azure.archive.ubuntu.com/d' /etc/apt/apt-mirrors.txt +echo "Using mirrors:" +cat /etc/apt/apt-mirrors.txt + # install needed packages export DEBIAN_FRONTEND="noninteractive" sudo apt-get -y update