[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 10631550f1 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 k.vasin@yadro.com
This commit is contained in:
Konstantin Vasin 2022-11-21 03:05:16 +03:00 committed by GitHub
parent bc174c686c
commit 6448afd338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 1 deletions

View File

@ -110,7 +110,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount
## Pointing apt to public apt mirrors and getting latest packages, needed for latest security updates
scripts/build_mirror_config.sh files/apt $CONFIGURED_ARCH $IMAGE_DISTRO
sudo cp files/apt/sources.list.$CONFIGURED_ARCH $FILESYSTEM_ROOT/etc/apt/sources.list
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/
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/
## Note: set lang to prevent locale warnings in your chroot
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update

View File

@ -30,6 +30,7 @@ COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"]
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"]
COPY ["apt-multiple-retries", "/etc/apt/apt.conf.d"]
# Update apt cache and
# pre-install fundamental packages

View File

@ -0,0 +1,4 @@
# Instruct apt to retry downloads on failures
# This is required only for bullseye.
Acquire::Retries "3";

View File

@ -0,0 +1,4 @@
# Instruct apt to retry downloads on failures
# This is required only for bullseye.
Acquire::Retries "3";

View File

@ -22,6 +22,7 @@ FROM {{ prefix }}debian:bullseye
MAINTAINER gulv@microsoft.com
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"]
COPY ["apt-multiple-retries", "/etc/apt/apt.conf.d/"]
{%- if CROSS_BUILD_ENVIRON != "y" %}
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]

View File

@ -0,0 +1,4 @@
# Instruct apt to retry downloads on failures
# This is required only for bullseye.
Acquire::Retries "3";