Skip to content

Commit d6d9d28

Browse files
Change APT to use mirror protocol
As part of the setup script, set APT to use the mirror protocol so that no matter where you are in the world, the closest mirror to you will be chosen. If you don't reside in the US it can be slow to download all the packages when building images. This will mean the best mirrors will be chosen regardless of the developer's location. Change-Id: Iadda26f38aad8526219da2e4ef0fd66150004829 Signed-off-by: Julian Carrivick <[email protected]>
1 parent 061e064 commit d6d9d28

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/provision/common.sh

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
# Add any logic that is common to both the peer and docker environments here
44

5+
# Use the mirror protocol for apt so that geographically close mirrors are automatically chosen
6+
source /etc/lsb-release
7+
8+
cat <<EOF > /etc/apt/sources.list
9+
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME main restricted universe multiverse
10+
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME-updates main restricted universe multiverse
11+
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME-backports main restricted universe multiverse
12+
deb mirror://mirrors.ubuntu.com/mirrors.txt $DISTRIB_CODENAME-security main restricted universe multiverse
13+
EOF
14+
515
apt-get update -qq
616

717
# Used by CHAINTOOL

0 commit comments

Comments
 (0)