diff --git a/build_debian.sh b/build_debian.sh index 10d1539381b..ea060249a1b 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -91,7 +91,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/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index 43ae42a11e6..0948f22bfc4 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -20,6 +20,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Configure data sources for apt/dpkg COPY ["sources.list", "/etc/apt/sources.list"] COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"] +COPY ["no-check-valid-until", "/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 00000000000..076933c27ae --- /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/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..076933c27ae --- /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 84dbaca3985..22a85b7f6de 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -47,6 +47,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 00000000000..076933c27ae --- /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/Dockerfile b/sonic-slave/Dockerfile index 35e73e3e308..2c7447fc00c 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 00000000000..076933c27ae --- /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";