Skip to main content

How to use apt-get install in environments

When building an environment, running apt-get install without the -y flag causes the following error:
The error message suggests a connectivity issue, but the actual cause is the missing -y confirmation switch. Without -y, apt-get waits for interactive input during the install prompt, which causes the non-zero exit code.

Fix: add the -y flag to apt-get install

Add the -y confirmation switch to your command so apt-get runs in non-interactive mode:
Last modified on October 12, 2026