Skip to content

Commit 5264f21

Browse files
Kyle Cutlerdeepak1556
authored andcommitted
ci: switch archive.ubuntu.com to azure.archive.ubuntu.com for snap (#74)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
1 parent b6d334f commit 5264f21

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

build/azure-pipelines/linux/build-snap.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ snapcraft --version
88
# This applies to both the apt commands below and snapcraft's internal apt operations for stage-packages
99
sudo sh -c 'echo "Acquire::Retries \"5\";" > /etc/apt/apt.conf.d/80-retries'
1010

11+
# Point apt at the Azure Ubuntu mirror. The build agents cannot reach
12+
# archive.ubuntu.com/ports.ubuntu.com (DNS resolves them to a non-routable
13+
# TEST-NET address, so connections time out), whereas the Azure mirror is
14+
# reachable. This must run before any apt operation and before snapcraft, since
15+
# snapcraft copies the host's /etc/apt configuration to download stage-packages.
16+
for src in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
17+
[ -f "$src" ] || continue
18+
sudo sed -i \
19+
-e 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' \
20+
-e 's|http://ports.ubuntu.com|http://azure.ports.ubuntu.com|g' \
21+
"$src"
22+
done
23+
1124
# Make sure we get latest packages
1225
sudo apt-get update
1326
sudo apt-get upgrade -y

0 commit comments

Comments
 (0)