From 3b3a4315af03ff6e866c9f4b3277642dfc46759b Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 3 Jan 2020 22:21:42 +0000 Subject: [PATCH] [201811][apt] Instruct apt-get to NOT check the "Valid Until" date in Release files --- build_debian.sh | 2 +- dockers/docker-base/no-check-valid-until | 3 +++ files/apt/apt.conf.d/no-check-valid-until | 4 ++++ sonic-slave-stretch/Dockerfile | 2 ++ sonic-slave-stretch/no-check-valid-until | 4 ++++ sonic-slave/Dockerfile | 2 ++ sonic-slave/no-check-valid-until | 4 ++++ 7 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 files/apt/apt.conf.d/no-check-valid-until create mode 100644 sonic-slave-stretch/no-check-valid-until create mode 100644 sonic-slave/no-check-valid-until diff --git a/build_debian.sh b/build_debian.sh index bd39013dc8e..1997275213f 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -93,7 +93,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount proc /proc -t proc ## Pointing apt to public apt mirrors and getting latest packages, needed for latest security updates sudo cp files/apt/sources.list $FILESYSTEM_ROOT/etc/apt/ -sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-languages}} $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} $FILESYSTEM_ROOT/etc/apt/apt.conf.d/ sudo LANG=C chroot $FILESYSTEM_ROOT bash -c 'apt-mark auto `apt-mark showmanual`' ## Note: set lang to prevent locale warnings in your chroot diff --git a/dockers/docker-base/no-check-valid-until b/dockers/docker-base/no-check-valid-until index 97b9c900518..c7c25d017f7 100644 --- a/dockers/docker-base/no-check-valid-until +++ b/dockers/docker-base/no-check-valid-until @@ -1 +1,4 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files +# Once the Debian team archives a repo, they stop updating this date + Acquire::Check-Valid-Until "false"; diff --git a/files/apt/apt.conf.d/no-check-valid-until b/files/apt/apt.conf.d/no-check-valid-until new file mode 100644 index 00000000000..c7c25d017f7 --- /dev/null +++ b/files/apt/apt.conf.d/no-check-valid-until @@ -0,0 +1,4 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files +# Once the Debian team archives a repo, they stop updating this date + +Acquire::Check-Valid-Until "false"; diff --git a/sonic-slave-stretch/Dockerfile b/sonic-slave-stretch/Dockerfile index eeac24ae847..9551e4b4615 100644 --- a/sonic-slave-stretch/Dockerfile +++ b/sonic-slave-stretch/Dockerfile @@ -2,6 +2,8 @@ FROM debian:stretch MAINTAINER gulv@microsoft.com +COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] + RUN echo "deb http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \ echo "deb http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ diff --git a/sonic-slave-stretch/no-check-valid-until b/sonic-slave-stretch/no-check-valid-until new file mode 100644 index 00000000000..c7c25d017f7 --- /dev/null +++ b/sonic-slave-stretch/no-check-valid-until @@ -0,0 +1,4 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files +# Once the Debian team archives a repo, they stop updating this date + +Acquire::Check-Valid-Until "false"; diff --git a/sonic-slave/Dockerfile b/sonic-slave/Dockerfile index abe43d9fe60..eb0c440a5b0 100644 --- a/sonic-slave/Dockerfile +++ b/sonic-slave/Dockerfile @@ -2,6 +2,8 @@ FROM debian:jessie MAINTAINER johnar@microsoft.com +COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] + ## Remove retired jessie-updates repo RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list diff --git a/sonic-slave/no-check-valid-until b/sonic-slave/no-check-valid-until new file mode 100644 index 00000000000..c7c25d017f7 --- /dev/null +++ b/sonic-slave/no-check-valid-until @@ -0,0 +1,4 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files +# Once the Debian team archives a repo, they stop updating this date + +Acquire::Check-Valid-Until "false";