diff --git a/build_debian.sh b/build_debian.sh index 85d0b503f962..1de4b0918f8f 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/* $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-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2 index eafbad8e6a31..c3e1c47a3921 100644 --- a/dockers/docker-base-stretch/Dockerfile.j2 +++ b/dockers/docker-base-stretch/Dockerfile.j2 @@ -20,7 +20,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Configure data sources for apt/dpkg COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"] COPY ["sources.list", "/etc/apt/sources.list"] -COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"] +COPY ["no-check-valid-until", "no-install-recommend-suggest", "/etc/apt/apt.conf.d/"] RUN apt-get update # Pre-install fundamental packages diff --git a/dockers/docker-base-stretch/no-check-valid-until b/dockers/docker-base-stretch/no-check-valid-until new file mode 100644 index 000000000000..076933c27ae7 --- /dev/null +++ b/dockers/docker-base-stretch/no-check-valid-until @@ -0,0 +1,3 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files + +Acquire::Check-Valid-Until "0"; diff --git a/dockers/docker-base-stretch/no_install_recommend_suggest b/dockers/docker-base-stretch/no-install-recommend-suggest similarity index 100% rename from dockers/docker-base-stretch/no_install_recommend_suggest rename to dockers/docker-base-stretch/no-install-recommend-suggest diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index 2aef59241b13..c91d0c3f79d6 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -20,7 +20,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Configure data sources for apt/dpkg COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"] COPY ["sources.list", "/etc/apt/sources.list"] -COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"] +COPY ["no-check-valid-until", "no-install-recommend-suggest", "/etc/apt/apt.conf.d/"] RUN apt-get update # Pre-install fundamental packages diff --git a/dockers/docker-base/no-check-valid-until b/dockers/docker-base/no-check-valid-until new file mode 100644 index 000000000000..076933c27ae7 --- /dev/null +++ b/dockers/docker-base/no-check-valid-until @@ -0,0 +1,3 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files + +Acquire::Check-Valid-Until "0"; diff --git a/dockers/docker-base/no_install_recommend_suggest b/dockers/docker-base/no-install-recommend-suggest similarity index 100% rename from dockers/docker-base/no_install_recommend_suggest rename to dockers/docker-base/no-install-recommend-suggest 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 000000000000..076933c27ae7 --- /dev/null +++ b/files/apt/apt.conf.d/no-check-valid-until @@ -0,0 +1,3 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files + +Acquire::Check-Valid-Until "0"; diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 0782ff1dc593..8edb4063a13a 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -50,6 +50,7 @@ sudo chroot $FILESYSTEM_ROOT service docker start # Apply apt configuration files sudo cp $IMAGE_CONFIGS/apt/sources.list $FILESYSTEM_ROOT/etc/apt/ sudo cp -R $IMAGE_CONFIGS/apt/sources.list.d/ $FILESYSTEM_ROOT/etc/apt/ +sudo cp $IMAGE_CONFIGS/apt/apt.conf.d/no-check-valid-until $FILESYSTEM_ROOT/etc/apt/apt.conf.d/ cat $IMAGE_CONFIGS/apt/sonic-dev.gpg.key | sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add - # Update apt's snapshot of its repos diff --git a/files/image_config/apt/apt.conf.d/no-check-valid-until b/files/image_config/apt/apt.conf.d/no-check-valid-until new file mode 100644 index 000000000000..076933c27ae7 --- /dev/null +++ b/files/image_config/apt/apt.conf.d/no-check-valid-until @@ -0,0 +1,3 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files + +Acquire::Check-Valid-Until "0"; diff --git a/sonic-slave-stretch/Dockerfile b/sonic-slave-stretch/Dockerfile index 9ab24a8151b2..7e07bc935966 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 000000000000..076933c27ae7 --- /dev/null +++ b/sonic-slave-stretch/no-check-valid-until @@ -0,0 +1,3 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files + +Acquire::Check-Valid-Until "0"; diff --git a/sonic-slave/Dockerfile b/sonic-slave/Dockerfile index 014df47d46f1..a6730b4fbd43 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/"] + RUN echo "deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \ echo "deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /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 000000000000..076933c27ae7 --- /dev/null +++ b/sonic-slave/no-check-valid-until @@ -0,0 +1,3 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files + +Acquire::Check-Valid-Until "0";