Apt install shell command hangs on configuration screen due to waiting on user input


My vagrant provisioning script won’t progress due to waiting on user input. The line is “apt install -y apt-cacher-ng”. The only problem is that it usually brings up a full screen message asking me to select yes or no however it doesn’t bring the screen up when running the provisioning script. The image below shows what usually comes up and the next image shows where it gets stuck. Does anyone know how to automatically select “No” in the first picture without my input?