4

When making Docker builds like this:

FROM debian:buster
RUN apt-get update && apt-get -y --no-install-recommends install \
      build-essential \
 && rm -rf /var/lib/apt/lists/*

I get the following warning:

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

It appears to be harmless, but is there an easy way to avoid it?

This does not get rid of the warning:

FROM debian:buster
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends \
      install build-essential

Here's a question about that warning in general: What does "debconf: delaying package configuration, since apt-utils is not installed" mean?

Lassi
  • 495
  • 1
  • 5
  • 10

3 Answers3

3

tl;dr: For Docker, you can use something like:

RUN DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes apt-get -y ...


Setting DEBIAN_FRONTEND=noninteractive does not quiet the debconf warning that "apt-utils is not installed", it just stops it from asking questions.

Setting DEBCONF_NOWARNINGS=yes causes debconf to

DEBCONF_NOWARNINGS: Set to "yes" to disable some warnings that debconf may display. Does not suppress display of fatal errors.

heurist
  • 31
  • 3
3

One way to deal with this is to tell debconf to not ask questions. You could do this for example via:

  • RUN DEBIAN_FRONTEND=noninteractive apt-get install ...
  • RUN export DEBIAN_FRONTEND=noninteractive && ...
  • ARG DEBIAN_FRONTEND=noninteractive

Please note: Don't use ENV to set this variable, as it would persist in the final image, which is probably not what you want.

gxx
  • 5,591
  • 2
  • 22
  • 42
  • Thanks for the clear suggestions. Unfortunately the message doesn't disappear (I edited the question to show the exact changes I made). I'm already using the `-y` flag to APT in an attempt to make it non-interactive; is `DEBIAN_FRONTEND=noninteractive` more than an alias for that? – Lassi Aug 21 '19 at 12:16
  • 1
    @Lassi Using the `-y` switch for `APT` will make `APT` assume `yes` for questions. Setting the frontend interacts with `debconf`, the tool used to configure packages. Both switches aren't necessarily related. For an explanation of the various frontends available, see `man 7 debconf`, this manual is shipped via `debconf-doc`. Unfortunately, I can't tell why it doesn't work for you. – gxx Aug 21 '19 at 13:14
2

It is safe to ignore this warning. It appears because the package you are installing can be configured interactively during installation. This warning means that the interactive configuration has been skipped. The default configuration is used instead, and using the default configuration is usually not an issue.

In order not to have this warning, you have to install apt-utils and disable the interactive configuration using the environment variable DEBIAN_FRONTEND. You will still get the warning while installing apt-utils, but after that, the new installation will be free of those warnings.

This can be done by adding the following lines to your Dockerfile:

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y apt-utils