> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use the apt-get install command in environments

> Fix the apt-get install non-zero exit code error in environment builds by adding the -y flag to run in non-interactive mode.

# 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 command '/bin/sh -c sudo apt-get install <package>' returned a non-zero code: 100
ERROR: ProgressMessage{id=null, status=null, stream=null,
error=The command '/bin/sh -c sudo apt-get install <package>' returned a non-zero code: 100, progress=null,
progressDetail=null}
```

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:

```
USER root
RUN apt-get install -y <package>
```


## Related topics

- [Troubleshooting](/knowledge-base/troubleshooting-overview.md)
- [Environment build fails with "The method driver /usr/lib/apt/methods/https could not be found"](/knowledge-base/environment-build-fails-with-the-method-driver-usr-lib-apt-methods-https-could-not-be-found.md)
- [Build error for nvidia GPG key](/knowledge-base/build-error-for-nvidia-gpg-key.md)
- [htop – Interactive process viewer: a brief overview](/knowledge-base/htop-interactive-process-viewer-a-brief-overview.md)
