@@ -13,6 +13,15 @@ sudo rm -f /etc/apt/heroku.list
13
13
sudo rm -f /etc/apt/openjdk-r-ubuntu-ppa-xenial.list
14
14
sudo rm -f /etc/apt/partner.list
15
15
16
+ retry () {
17
+ $* || $* || $* || $* || $*
18
+ }
19
+
20
+ # Method adapted from here: https://askubuntu.com/questions/875213/apt-get-to-retry-downloading
21
+ # (with use of tee to avoid permissions problems)
22
+ # This is better than retrying the whole apt-get command
23
+ echo " APT::Acquire::Retries \" 3\" ;" | sudo tee /etc/apt/apt.conf.d/80-retries
24
+
16
25
sudo apt-get -y update
17
26
sudo apt-get -y remove linux-image-generic linux-headers-generic linux-generic docker-ce
18
27
# WARNING: Docker version is hardcoded here; you must update the
@@ -27,7 +36,11 @@ sudo apt-get -y remove linux-image-generic linux-headers-generic linux-generic d
27
36
# Ubuntu version (e.g., docker run -it ubuntu:16.04) and then ask
28
37
# apt what the packages you need are. Note that the CircleCI image
29
38
# comes with Docker.
30
- sudo apt-get -y install \
39
+ #
40
+ # Using 'retry' here as belt-and-suspenders even though we are
41
+ # presumably retrying at the single-package level via the
42
+ # apt.conf.d/80-retries technique.
43
+ retry sudo apt-get -y install \
31
44
linux-headers-$( uname -r) \
32
45
linux-image-generic \
33
46
moreutils \
@@ -38,9 +51,6 @@ sudo apt-get -y install \
38
51
39
52
sudo pkill -SIGHUP dockerd
40
53
41
- retry () {
42
- $* || $* || $* || $* || $*
43
- }
44
54
45
55
retry sudo pip -q install awscli==1.16.35
46
56
0 commit comments