Auto accept the libcudnn7 license

I am trying to automate the Lambda Stack install on my Ubuntu 18.04 machine using a script, but I am not sure how to avoid for the libcudnn7 prompt to accept the license. I’ve tried the -y options with apt-get install and setting environmental variables such as export DEBIAN_FRONTEND=noninteractive and export ACCEPT_EULA=Y.
The command I am running in the script is taken right from the website:

#!/bin/bash

set -e

export DEBIAN_FRONTEND=noninteractive
export ACCEPT_EULA=Y

# Enable Ubuntu 'Main', 'Universe' and  repositories
sudo add-apt-repository -y main
sudo add-apt-repository -y universe
sudo apt-get update -y

# Install Lambda Labs Stack
LAMBDA_REPO=$(mktemp) && \
wget -O${LAMBDA_REPO} https://lambdalabs.com/static/misc/lambda-stack-repo.deb && \
sudo dpkg -i ${LAMBDA_REPO} && rm -f ${LAMBDA_REPO} && \
sudo apt-get update && \
sudo apt-get --yes upgrade && \
sudo apt-get install --yes --no-install-recommends lambda-stack-cuda

sudo ldconfig

exit 0

I am going to try the following:

Of course I missed the whole section :man_facepalming: :
Use Lambda Stack in a shell script, Dockerfile, Ansible file, etc.*

LAMBDA_REPO=$(mktemp) && \
wget -O${LAMBDA_REPO} https://lambdalabs.com/static/misc/lambda-stack-repo.deb && \
sudo dpkg -i ${LAMBDA_REPO} && rm -f ${LAMBDA_REPO} && \
sudo apt-get update && \
sudo apt-get --yes upgrade && \
echo "cudnn cudnn/license_preseed select ACCEPT" | sudo debconf-set-selections && \
sudo apt-get install --yes --no-install-recommends lambda-server && \
sudo apt-get install --yes --no-install-recommends nvidia-450 libcuda1-450 nvidia-opencl-icd-450 && \
sudo apt-get install --yes --no-install-recommends lambda-stack-cuda