baseimage-docker: [16.04] debconf: delaying package configuration, since apt-utils is not installed
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.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 62
- Comments: 61
Links to this issue
Commits related to this issue
- Borrow some practices from phusion/baseimage See https://github.com/phusion/baseimage-docker/issues/319 See https://github.com/tianon/docker-brew-ubuntu-core/issues/59 — committed to krmcbride/dockerfiles by krmcbride 7 years ago
- Update Dockerfile Added fix from https://github.com/phusion/baseimage-docker/issues/319 — committed to axl89/rpi-owncloud by axl89 7 years ago
- Enhancing Dockerfile Locally, I pull first from artifactory which might have a custom version of ubuntu that has tzdata already. The conditional makes extending the use in other environments a lot ea... — committed to Aergonus/kube-monkey by Spellchaser 7 years ago
- Enhancing Dockerfile Locally, I pull first from artifactory which might have a custom version of ubuntu that has tzdata already. The conditional makes extending the use in other environments a lot ea... — committed to asobti/kube-monkey by Aergonus 7 years ago
- add DEBIAN_FRONTEND=noninteractive to prevent warning see https://github.com/phusion/baseimage-docker/issues/319 — committed to hazybluedot/rmarkdown-gitlab-runner by hazybluedot 6 years ago
- change ENV DEBIAN_FRONTEND to teletype because of warnings, see here https://github.com/phusion/baseimage-docker/issues/319 — committed to ulkoenig/ubuntu-dev by ulkoenig 5 years ago
- workaround for apt-utils bug (https://github.com/phusion/baseimage-docker/issues/319#issuecomment-518057589) — committed to bqstony/zookeeper-docker by bqstony 5 years ago
- Resolve apt-utils error `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 ... — committed to briangleeson/greenwell-tekton-1 by briangleeson 4 years ago
- Fixed warning when the docker runs commands Fixed problem with help these resources: https://stackoverflow.com/questions/51023312/docker-having-issues-installing-apt-utils https://github.com/phusio... — committed to shmidtelson/action-wordpress-plugin-deploy by shmidtelson 4 years ago
- fix: docker build [16.04] debconf: delaying package configuration, since apt-utils is not installed #319: https://github.com/phusion/baseimage-docker/issues/319 — committed to jabardigitalservice/DataSae by pipinfitriadi 4 months ago
My solution is just to put a
line in the docker file and it fixes the problem.
It did not worked for me =/
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.
didn’t work for me too.
@aairey Did you try adding this to your Dockerfile?
RUN apt-get update && apt-get install -y --no-install-recommends apt-utilsI 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
in the beginning of the Docker file and I set
At the very end. This way both interactive and non-interactive modes get set.
@danielxfr how about:
When I install apt-utils before the rest of apt packages, I only get
delaying package configurationfor the installation of the apt-utils package, which makes sense. However, I get the following warnings for the other packages:Apparently this is also a harmless warning that can be avoided by setting
DEBIAN_FRONTEND=noninteractiveas 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 https://github.com/docker/docker/issues/4032#issuecomment-192327844 .
The key takeaway there is make sure you don’t use
ENVto 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?
sudo aptitude install apt-utils
in the end the reco from @stephanwehr is enough: just add this at the beginning of your dockerfile
my solution
apt-get update && apt-get install -y --no-install-recommends apt-utils
I am quite curious if someone manages to result the apt-utils issue without triggering any warnings. Ignoring warnings in builds is very bad practice, once you let them in, they will grow exponentially and everyone will ignore them.
I don’t get why this issue is closed, it is still an issue. This is my Dockerfile:
And these are my logs, from running
docker-compose buildI will reopen this issue until we come to a conclusion.
FWIW It is better to use
ARGon newer docker installations, as this only sets theENVduring build time (See https://github.com/moby/moby/issues/4032).But I am still getting the warnings about apt-utils.
The behavior is controlled by the configuration setting:
DPkg::Pre-Install-PkgsThe default setting is configured via “/etc/apt/apt.conf.d/70debconf”:
To disable the setting permanently:
To disable the setting temporarily:
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”.
References: debconf - Preconfiguring packages apt.conf - SYNTAX
While the issue has been closed but still unclear solution on this case that already runs for years .
Currently the highest votes goes to:
but it still gives the warning
@hyperknot Why two
ENVinstead of a single (and more future-proof)ARG?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!
Simplest answer, the nasty warning is finally gone
Building off of https://github.com/phusion/baseimage-docker/issues/319#issuecomment-573368959 from @sebthom; if you use bash, you can keep STDERR text separate from STDOUT and apply the grep pattern only in the STDERR text:
I am assuming you get this message while installing apt-utils, indicating that apt-utils hasn’t finished installing yet, but that subsequent apt-get install invocations no longer print the warning. Is that not the case?
It’s weird since I do
apt-get update && apt-get install -y --no-install-recommends apt-utilsbut I get anyways the messageThey are totally different. ENV is persistent in the image. It’d still need two cases here.
You need both apt-utils and noninteractive. Installing apt-utils is really not making any difference in build speed, it’s a tiny util which should actually be part of official image.
But why do you need to persist it (which overrides the default)? The default frontend works for me. In addition,
--no-install-recommendscan be omitted since apt-utils doesn’t have any recommended package.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.
I found this solution from: https://stackoverflow.com/questions/51023312/docker-having-issues-installing-apt-utils
it consists of following the
apt-get installcommand on the same line asENV DEBIAN_FRONTEND noninteractive:DEBIAN_FRONTEND=noninteractive apt-get install -y pkgs...@Theaxiom I’d definitely add apt-utils here: https://github.com/hyperknot/baseimage16/blob/master/image/prepare.sh#L34 and teletype at the end: https://github.com/hyperknot/baseimage16/blob/master/image/Dockerfile#L19
noninteractive is already part of buildconfig
@hyperknot Are you proposing this be added to baseimage-docker?
@Theaxiom this just installs
apt-utils? I thought there was a way to just make the warning go away without installingapt-utils. Whenapt-utilsis 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 installingapt-utils?@franklinyu it works for me just using
ARG. Theapt-utilswarning and reason for usingnoninteractiveis unrelated. (unless I am missing something?). Thenoninteractivesetting just makes sure no dialogs are opened and thatdpkg-reconfiguredus not prompt you for input. At least that is my understanding after fiddling around with it yesterday. And thus you should always usenoninteractivewhen usingapt-getduring build.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,
teletypeis not a known value forDEBIAN_FRONTENDaccording to documentation online (??); thenewt, mentioned as default in documentation, still produces the warning for me (???).