Skip to content

Commit 36f7939

Browse files
kv-yStormLiangMS
authored andcommitted
[Build] set apt Acquire::Retries to 3 for bullseye (#12758)
Why I did it There were some changes in apt source code in version 2.1.9. As a result apt used in bullseye (2.2.4) is intolerant to network issues. This was fixed in https://salsa.debian.org/apt-team/apt/-/commit/10631550f1f9788bdfd64d2434237a1448ab0626 Already fixed version is used in bookworm (2.5.4) And not yet affected version is used in buster (1.8.2.3) How I did it Set Acquire::Retries to 3 for sonic-slave-bullseye, docker-base-bullseye and final Debian image. Ref: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1876035 Signed-off-by: Konstantin Vasin [email protected]
1 parent 382243b commit 36f7939

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

build_debian.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount
110110
## Pointing apt to public apt mirrors and getting latest packages, needed for latest security updates
111111
scripts/build_mirror_config.sh files/apt $CONFIGURED_ARCH $IMAGE_DISTRO
112112
sudo cp files/apt/sources.list.$CONFIGURED_ARCH $FILESYSTEM_ROOT/etc/apt/sources.list
113-
sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-languages},no-check-valid-until} $FILESYSTEM_ROOT/etc/apt/apt.conf.d/
113+
sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-languages},no-check-valid-until,apt-multiple-retries} $FILESYSTEM_ROOT/etc/apt/apt.conf.d/
114114

115115
## Note: set lang to prevent locale warnings in your chroot
116116
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update

dockers/docker-base-bullseye/Dockerfile.j2

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"]
3030
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
3131
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
3232
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"]
33+
COPY ["apt-multiple-retries", "/etc/apt/apt.conf.d"]
3334

3435
# Update apt cache and
3536
# pre-install fundamental packages
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Instruct apt to retry downloads on failures
2+
# This is required only for bullseye.
3+
4+
Acquire::Retries "3";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Instruct apt to retry downloads on failures
2+
# This is required only for bullseye.
3+
4+
Acquire::Retries "3";

sonic-slave-bullseye/Dockerfile.j2

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ FROM {{ prefix }}debian:bullseye
2222
2323

2424
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"]
25+
COPY ["apt-multiple-retries", "/etc/apt/apt.conf.d/"]
2526

2627
{%- if CROSS_BUILD_ENVIRON != "y" %}
2728
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Instruct apt to retry downloads on failures
2+
# This is required only for bullseye.
3+
4+
Acquire::Retries "3";

0 commit comments

Comments
 (0)