dark
debconf: delaying package configuration, since apt-utils is not installed

Try the solution of debconf: delaying package configuration, since apt-utils is not installed

Solution:

It is actually not a bug that can be ignored safely. There are large numbers of images that are created by a solution, never having apt-utils on any of them. Ignore this warning message, all of the packages will be installed correctly and work fine.

Anyway, if you want to have apt-utils, install them. It will give you this warning once and then disappear for future apt-get calls (as you can see in its own log, it curl was installed without this message).

NOTE If the user installs apt-utils, the user will get some warnings. These warnings are because the installer can run the configuration and fails… To avoid these warnings and have packages with an interactive default configuration, try to run apt-get like this DEBIAN_FRONTEND=noninteractive apt-get install -y pkgs....

There are several alternatives instead of putting DEBIAN_FRONTEND=noninteractive before each time apt-get install -y {your-pkgs}:

Method 1: ARG DEBIAN_FRONTEND = non-interactive

The ARG instruction is used to defines a variable that users can pass during build using the docker build command that is –build-arg = flag

Solution characteristics:

  • The instruction ARG is only set during build time
  • The parameter ‘no interactive’ is set by default during build time only.
  • Since it is an argument can be changed by passing a different value for the argument, for example docker build –build-arg DEBIAN_FRONTEND=newt

Example:

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get -yq install {your-pkgs}

Method 2: On-the-fly

This is the solution from Leo K.

Solution characteristics:

  • It can be installed whenever user needed. That is why it is a good solution.
  •  It can be set to a different value for a particular command that is why it is not set globally.
  • The scope of this RUN and it will not affect other directives.

Example:

RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install {your-pkgs}

Method 3: ENV DEBIAN_FRONTEND = non-interactive

Installation could ENV DEBIAN_FRONTEND noninteractive also be used as an alternative, but this is highly not recommended.

Another way is to install at the beginning and uncheck it when you finish the installation of the Dockerfile.

Solution characteristics:

  • The directive will ENV preserve the environment variable after build (not recommended), in addition
  • It can be error prone if you forget to set it back to its default.
  • Since it is specified with ENV, it will be inherited by all images and content built from this image, effectively changing their behavior. (As mentioned in [ 1 ])], people using these images have problems installing software interactively because the installers do not show any dialog boxes.
  • The default frontend is DEBIAN_FRONTEND=newt (see [ 2 ], so it should be set at the end of the file.

Example:

# Set for all apt-get install, must be at the very beginning of the Dockerfile.

ENV DEBIAN_FRONTEND noninteractive

# Non-interactive modes get set back.

ENV DEBIAN_FRONTEND newt

Alternative 4: RUN export DEBIAN_FRONTEND = non-interactive

Solution characteristics:

  • It is similar to method 2
  • When decoupling, cohesion suffers: why is this variable exported and what it belongs to (apt-get).
  • The scope of this RUN and it will not affect other directives.

Example:

# Set the frontend and then install your package

RUN export DEBIAN_FRONTEND=noninteractive && \

    …

    apt-get -yq install {your-pkgs} && \

    …

Total
14
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
given a string, return a string where for every char in the original, there are two chars.

Solution of ” given a string, return a string where for every char in the original, there are two chars.” Problem.

Related Posts