File tree Expand file tree Collapse file tree
build/azure-pipelines/linux Expand file tree Collapse file tree Original file line number Diff line number Diff 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
99sudo 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
1225sudo apt-get update
1326sudo apt-get upgrade -y
You can’t perform that action at this time.
0 commit comments