[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:
parent
bc174c686c
commit
6448afd338
@ -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
|
## 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
|
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/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
|
## Note: set lang to prevent locale warnings in your chroot
|
||||||
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update
|
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update
|
||||||
|
@ -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 ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
|
||||||
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
|
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
|
||||||
COPY ["no-check-valid-until", "/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
|
# Update apt cache and
|
||||||
# pre-install fundamental packages
|
# pre-install fundamental packages
|
||||||
|
4
dockers/docker-base-bullseye/apt-multiple-retries
Normal file
4
dockers/docker-base-bullseye/apt-multiple-retries
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Instruct apt to retry downloads on failures
|
||||||
|
# This is required only for bullseye.
|
||||||
|
|
||||||
|
Acquire::Retries "3";
|
4
files/apt/apt.conf.d/apt-multiple-retries
Normal file
4
files/apt/apt.conf.d/apt-multiple-retries
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Instruct apt to retry downloads on failures
|
||||||
|
# This is required only for bullseye.
|
||||||
|
|
||||||
|
Acquire::Retries "3";
|
@ -22,6 +22,7 @@ FROM {{ prefix }}debian:bullseye
|
|||||||
MAINTAINER gulv@microsoft.com
|
MAINTAINER gulv@microsoft.com
|
||||||
|
|
||||||
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"]
|
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"]
|
||||||
|
COPY ["apt-multiple-retries", "/etc/apt/apt.conf.d/"]
|
||||||
|
|
||||||
{%- if CROSS_BUILD_ENVIRON != "y" %}
|
{%- if CROSS_BUILD_ENVIRON != "y" %}
|
||||||
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
|
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
|
||||||
|
4
sonic-slave-bullseye/apt-multiple-retries
Normal file
4
sonic-slave-bullseye/apt-multiple-retries
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Instruct apt to retry downloads on failures
|
||||||
|
# This is required only for bullseye.
|
||||||
|
|
||||||
|
Acquire::Retries "3";
|
Loading…
Reference in New Issue
Block a user