How to use the apt-get install command in environments

andrea.loweandrea.lowe Member, Moderator, Domino Posts: 27 mod

When building an environment the following errors may be seen when running an apt-get install command

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}

When running the apt-get command, the -y switch must also be used to confirm any prompts, otherwise the install may fail. As we can see in this case the error hints towards connectivity when in fact it was missing the confirmation switch to run in non-interactive mode.

To fix this, add a confirmation switch into your command, for example:

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


Sign In or Register to comment.