Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.04] debconf: delaying package configuration, since apt-utils is not installed #319

Closed
hyperknot opened this issue Jul 14, 2016 · 61 comments
Assignees
Milestone

Comments

@hyperknot
Copy link
Collaborator

hyperknot commented Jul 14, 2016

On newest image 0.9.19, if I run any apt-get command, I received the following red warning line:
debconf: delaying package configuration, since apt-utils is not installed

Minimal example:

FROM phusion/baseimage:0.9.19

# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]

# ...put your own build instructions here...
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

This is only happening in 0.9.19 / Ubuntu 16.04.

@hyperknot hyperknot changed the title debconf: delaying package configuration, since apt-utils is not installed 16.04: debconf: delaying package configuration, since apt-utils is not installed Jul 14, 2016
@hyperknot hyperknot changed the title 16.04: debconf: delaying package configuration, since apt-utils is not installed [16.04] debconf: delaying package configuration, since apt-utils is not installed Jul 14, 2016
@FranklinYu
Copy link

FranklinYu commented Aug 2, 2016

Upstream problem; I can confirm this with clean image ubuntu:16.04. Reporting to them at tianon/docker-brew-ubuntu-core#59.

@aa21
Copy link

aa21 commented Sep 8, 2016

Did you find any solutions for this? @hyperknot @FranklinYu

@hyperknot
Copy link
Collaborator Author

yes, I'm installing it myself

On Thursday, 8 September 2016, aa notifications@github.com wrote:

Did you find any solutions for this? @hyperknot
https://github.com/hyperknot @FranklinYu https://github.com/franklinyu


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#319 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeKj3pTbewfwizfVv8RAwaA58N22DN7ks5qn5TUgaJpZM4JMfSU
.

@FranklinYu
Copy link

@aa21 I did not. The Debian-Docker guys thought this is an issue of APT incorrectly requiring the (unnecessary) package, and refused to fix it, since this is just a warning not able to stop you from anything. I guess they are too busy for it.

Good to hear that @hyperknot is trying to fix it. I am looking forward to his solution/workaround.

@hyperknot
Copy link
Collaborator Author

My solution is just to put a

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

line in the docker file and it fixes the problem.

@aa21
Copy link

aa21 commented Sep 13, 2016

Thanks @hyperknot and @FranklinYu.

@WesleyBatista
Copy link

It did not worked for me =/

Step 2 : ENV DEBIAN_FRONTEND noninteractive
 ---> Running in 1b35b989ce4d
 ---> 78f654f9ea69
Removing intermediate container 1b35b989ce4d
Step 3 : RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
 ---> Running in 29d7eb2e1bb5
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial/main Sources [1103 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [5179 B]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [250 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [129 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [522 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [432 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-security/main Sources [52.7 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-security/universe Sources [13.4 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [196 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [62.2 kB]
Fetched 18.4 MB in 4min 14s (72.2 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libapt-inst2.0
The following NEW packages will be installed:
  apt-utils libapt-inst2.0
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 251 kB of archives.
After this operation, 1203 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapt-inst2.0 amd64 1.2.12~ubuntu16.04.1 [55.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt-utils amd64 1.2.12~ubuntu16.04.1 [196 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 251 kB in 1s (176 kB/s)
Selecting previously unselected package libapt-inst2.0:amd64.
(Reading database ... 7256 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.2.12~ubuntu16.04.1_amd64.deb ...
Unpacking libapt-inst2.0:amd64 (1.2.12~ubuntu16.04.1) ...
Selecting previously unselected package apt-utils.
Preparing to unpack .../apt-utils_1.2.12~ubuntu16.04.1_amd64.deb ...
Unpacking apt-utils (1.2.12~ubuntu16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Setting up libapt-inst2.0:amd64 (1.2.12~ubuntu16.04.1) ...
Setting up apt-utils (1.2.12~ubuntu16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

@Lewiscowles1986
Copy link

it's the only red command I now get when setting up my jekyll x86 base image...

@yosualb
Copy link

yosualb commented Nov 23, 2016

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-utils

didn't work for me too.

@hyperknot
Copy link
Collaborator Author

hyperknot commented Nov 24, 2016

It is a harmless 1 line warning message.

The command does get installed, and following apt-get commands do not show any error / warning messages.

@hyperknot
Copy link
Collaborator Author

I started making an updated fork of this project, containing Ubuntu 16.04 fixes, including this one. Have a look here:
https://github.com/hyperknot/baseimage16

@vlymar
Copy link

vlymar commented Jan 13, 2017

The command does get installed, and following apt-get commands do not show any error / warning messages.

When I install apt-utils before the rest of apt packages, I only get delaying package configuration for the installation of the apt-utils package, which makes sense. However, I get the following warnings for the other packages:

debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 

Apparently this is also a harmless warning that can be avoided by setting DEBIAN_FRONTEND=noninteractive as some others have in this thread.

If anyone is wondering what the best-practice way to set this variable is, this is the best info I could find moby/moby#4032 (comment) .

The key takeaway there is make sure you don't use ENV to set this because it will persist in the image, but you only want that value set during the docker build stage.

I wonder though, what if you're installing a package that does depend on interactive configuration? Does apt-get just fail, or will it just silently leave the package unconfigured?

@hyperknot
Copy link
Collaborator Author

I don't think apt-get allows packages which only work in interactive mode. So all packages must work in noninteractive mode.

What I do is I set

ENV DEBIAN_FRONTEND noninteractive

in the beginning of the Docker file
and I set

ENV DEBIAN_FRONTEND teletype

At the very end. This way both interactive and non-interactive modes get set.

@FranklinYu
Copy link

@hyperknot Why two ENV instead of a single (and more future-proof) ARG?

@hyperknot
Copy link
Collaborator Author

They are totally different. ENV is persistent in the image. It'd still need two cases here.

@FranklinYu
Copy link

FranklinYu commented Jan 16, 2017

But why do you need to persist it (which overrides the default)? The default frontend works for me. In addition, --no-install-recommends can be omitted since apt-utils doesn't have any recommended package.

@hyperknot
Copy link
Collaborator Author

hyperknot commented Jan 16, 2017 via email

@FranklinYu
Copy link

FranklinYu commented Jan 16, 2017

Yes, I just confirmed that. I thought the default only gives warning when installing packages in Dockerfile. I missed that because the warning was not highlighted as red (of course), and that doesn't happen on normal Ubuntu. However, teletype is not a known value for DEBIAN_FRONTEND according to documentation online (??); the newt, mentioned as default in documentation, still produces the warning for me (???).

@hyperknot
Copy link
Collaborator Author

hyperknot commented Jan 16, 2017 via email

@Theaxiom
Copy link
Collaborator

Being that this is an upstream issue, I am closing this issue. It looks like there is a viable workaround and this issue will remain for posterity.

@aairey
Copy link

aairey commented Apr 23, 2017

FWIW
It is better to use ARG on newer docker installations, as this only sets the ENV during build time (See moby/moby#4032).

ARG DEBIAN_FRONTEND=noninteractive

But I am still getting the warnings about apt-utils.

@Theaxiom
Copy link
Collaborator

@aairey Did you try adding this to your Dockerfile?

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

@FranklinYu
Copy link

@aairey We discussed about why we need ENV instead of ARG above.

@aairey
Copy link

aairey commented Apr 24, 2017

@Theaxiom this just installs apt-utils?
I thought there was a way to just make the warning go away without installing apt-utils.
When apt-utils is installed, the build is way slower, and since it is not the default I prefer not to install it.
But seems there is no way to get rid of the warning without installing apt-utils?

@FranklinYu it works for me just using ARG.
The apt-utils warning and reason for using noninteractive is unrelated. (unless I am missing something?).
The noninteractive setting just makes sure no dialogs are opened and that dpkg-reconfigure dus not prompt you for input.
At least that is my understanding after fiddling around with it yesterday.
And thus you should always use noninteractive when using apt-get during build.

@Theaxiom
Copy link
Collaborator

@aairey Unfortunately, I think that is indeed the only way to make the error message go away. From what I understand it is a no-op.

@sebthom
Copy link

sebthom commented Jan 12, 2020

@danielxfr how about:

FROM ...

ARG DEBIAN_FRONTEND=noninteractive

RUN \
  apt-get update -y && \
  apt-get install -y apt-utils 2>&1 | grep -v "debconf: delaying package configuration, since apt-utils is not installed" && \
  apt-get install -y --no-install-recommends package1,package2,...

@Theaxiom
Copy link
Collaborator

I will reopen this issue until we come to a conclusion.

@Theaxiom Theaxiom reopened this Jan 30, 2020
@alanivey
Copy link

Building off of #319 (comment) from @sebthom; if you use bash, you can keep STDERR text separate from STDOUT and apply the grep pattern only in the STDERR text:

FROM ...

ARG DEBIAN_FRONTEND=noninteractive

SHELL ["/bin/bash", "-c"]

RUN \
  apt-get update -y && \
  apt-get install -y apt-utils 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 ) && \
  apt-get install -y --no-install-recommends package1,package2,...

briangleeson added a commit to briangleeson/greenwell-tekton-1 that referenced this issue May 12, 2020
`debconf: delaying package configuration, since apt-utils is not installed` error is appearing in pipeline runs, and possibly causing failures on DEV e2e runs. Seems to be an [underlying issue in ubuntu image](phusion/baseimage-docker#319)
shmidtelson added a commit to shmidtelson/action-wordpress-plugin-deploy that referenced this issue Sep 5, 2020
@marcusjwhelan
Copy link

This is also an issue exists on Ubuntu's 18.04 image

@nysta1
Copy link

nysta1 commented Jun 23, 2021

I too have this apt-utils problem and it's really bringing the grade of development down, it says unable to.further configure after this.

@rufreakde
Copy link

Having also the apt-utils issue and when I want to install gcc of a specific version it also does not export it in the PATH correctly... after adding the install line of apt-utils it at least added the gcc files into the bin directory.

RUN                                                                                                                     \
    set     -eux                                                                                                        \ 
    && apt-get -y update                                                                                                \
    && apt-get install -y apt-utils                                                                                     \
	&& apt-get -y install --no-install-recommends --no-install-suggests --fix-missing bash-static                       \
    && apt-get -y install gcc-4.8                                                                                       \
    && apt-get -y install make                                                                                          \
    && cp /bin/bash-static /sh

then I get the following errors on make gcc and so on:

debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7, <> line 21.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 

After some googling I found this here
moby/moby#27988

added the dialog apt-utils line but the error still persists not sure if both problems are related. Anyone else having the same behaviour on ubuntu:18.04 image?

RUN                                                                                                                     \
    set     -eux                                                                                                        \ 
    && apt-get -y update                                                                                                \
    && apt-get install -y dialog apt-utils                                                                              \
    && apt-get -y install --no-install-recommends --no-install-suggests --fix-missing bash-static                       \
    && apt-get -y install gcc-4.8                                                                                       \
    && apt-get -y install make                                                                                          \
    && cp /bin/bash-static /sh            

@rufreakde
Copy link

rufreakde commented Jul 16, 2021

Update: just adding seems to do the trick for the ubuntu image. gcc is still not found in the path but that I can fix by hand.

ENV DEBIAN_FRONTEND="noninteractive"

RUN ln -s /usr/bin/gcc-4.8 /usr/bin/gcc

@stephanwehr
Copy link

The behavior is controlled by the configuration setting:
DPkg::Pre-Install-Pkgs

The default setting is configured via "/etc/apt/apt.conf.d/70debconf":

// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};

To disable the setting permanently:

RUN set -x \
&& sed -Ei 's|^(DPkg::Pre-Install-Pkgs .*)|#\1|g' /etc/apt/apt.conf.d/70debconf \
&& apt-get update \
&& apt-get upgrade -y

To disable the setting temporarily:

RUN set -x \
&& mv /etc/apt/apt.conf.d/70debconf . \
&& apt-get update \
&& apt-get install -y apt-utils \
&& mv 70debconf /etc/apt/apt.conf.d \
&& apt-get upgrade -y

Show less debconf warnings:
ARG DEBCONF_NOWARNINGS="yes"

Here is an example Docker file including all methods mentioned above, pick the one that fits your use case.
To get the full "apt-get" output, remove "-qq" and ">/dev/null".

ARG IMAGE="ubuntu:16.04"
FROM ${IMAGE}

ARG DEBIAN_FRONTEND="noninteractive"
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBCONF_TERSE="yes"
ARG APT="apt-get -qq -y"
ARG LANG="C.UTF-8"

# Configure APT
RUN set -x \
&& echo "debconf debconf/frontend select ${DEBIAN_FRONTEND}" | debconf-set-selections \
&& echo 'APT::Install-Recommends "false";' | tee /etc/apt/apt.conf.d/99install-recommends \
&& echo 'APT::Get::Assume-Yes "true";' | tee /etc/apt/apt.conf.d/99assume-yes \
&& sed -Ei 's|^(DPkg::Pre-Install-Pkgs .*)|#\1|g' /etc/apt/apt.conf.d/70debconf \
&& debconf-show debconf

# Install Packages
RUN set -x \
&& mv /etc/apt/apt.conf.d/70debconf . \
&& ${APT} update \
&& ${APT} install apt-utils >/dev/null \
&& mv 70debconf /etc/apt/apt.conf.d \
&& ${APT} upgrade >/dev/null \
&& ${APT} install curl >/dev/null

References:
debconf - Preconfiguring packages
apt.conf - SYNTAX

@Theaxiom
Copy link
Collaborator

Thank you @stephanwehr for your insight! :)

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the Stale label Sep 16, 2021
@github-actions
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@boussou
Copy link

boussou commented Mar 4, 2022

in the end the reco from @stephanwehr is enough:
just add this at the beginning of your dockerfile

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NOWARNINGS="yes"

@rolandhemmer
Copy link

in the end the reco from @stephanwehr is enough: just add this at the beginning of your dockerfile

ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NOWARNINGS="yes"

This. This is exactly what I was looking for.
These two lines (and these two only) work exactly as intended. Didn't have to do anything else, no more warnings, life goes on, my wife didn't leave me, my dog is happy, I can finally rest.
Many thanks!

@Mugane
Copy link

Mugane commented Apr 24, 2022

Even after adding

ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

I still get this for the install of apt-utils:

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libapt-inst2.0
The following NEW packages will be installed:
  apt-utils libapt-inst2.0
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 625 kB of archives.
After this operation, 1650 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libapt-inst2.0 amd64 1.8.2.3 [204 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 apt-utils amd64 1.8.2.3 [421 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 625 kB in 0s (49.9 MB/s)
Selecting previously unselected package libapt-inst2.0:amd64.
(Reading database ... 29516 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.8.2.3_amd64.deb ...
Unpacking libapt-inst2.0:amd64 (1.8.2.3) ...
Selecting previously unselected package apt-utils.
Preparing to unpack .../apt-utils_1.8.2.3_amd64.deb ...
Unpacking apt-utils (1.8.2.3) ...
Setting up libapt-inst2.0:amd64 (1.8.2.3) ...
Setting up apt-utils (1.8.2.3) ...
Processing triggers for libc-bin (2.28-10+deb10u1) ...
Removing intermediate container 90a8af7fd7b2

Notice that it still produces the warning:

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

However this warning only appears for the install of apt-utils, and additional warnings do not show up for installs of other packages after this initial warning

@qindongliang
Copy link

in the end the reco from @stephanwehr is enough: just add this at the beginning of your dockerfile

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NOWARNINGS="yes"

Simplest answer, the nasty warning is finally gone

pipinfitriadi added a commit to jabardigitalservice/DataSae that referenced this issue Feb 24, 2024
[16.04] debconf: delaying package configuration, since apt-utils is not installed #319: phusion/baseimage-docker#319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests