#1066021 pbuilder: debconf crashes while configuring pbuilder in debian:12.5 docker container

#1066021#5
Date:
2024-03-11 01:15:30 UTC
From:
To:
Dear Maintainer,

I'm not sure if this should be filed against debconf or pbuilder or both (does the Package line support multiple packages?)
It was also not clear how to report bugs against the official Debian Docker image

A Dockerfile with the following:
FROM debian:12.5
RUN apt update && apt install --no-install-recommends -y pbuilder

will loop the following:
#5 3.737 Setting up pbuilder (0.231) ...
#5 3.774 debconf: unable to initialize frontend: Dialog
#5 3.774 debconf: (TERM is not set, so the dialog frontend is not usable.)
#5 3.774 debconf: falling back to frontend: Readline
#5 3.780 debconf: unable to initialize frontend: Readline
#5 3.780 debconf: (This frontend requires a controlling tty.)
#5 3.780 debconf: falling back to frontend: Teletype
#5 3.790 Configuring pbuilder
#5 3.790 --------------------
#5 3.790
#5 3.790 Default mirror not found
#5 3.790
#5 3.790 Mirror information detection failed and the user provided no mirror
#5 3.790 information.
#5 3.790
#5 3.790 Please enter valid mirror information.
#5 3.790
#5 3.790 Please enter the default mirror you want to be used by pbuilder.
#5 3.790
#5 3.790 If you leave this field blank, there will be one attempt to autodetect this
#5 3.790 information. If this attempt fails, you will be prompted again to insert some
#5 3.790 valid mirror information.
#5 3.790
#5 3.790 Here is a valid mirror example: http://deb.debian.org/debian

I believe this is due to deb822 format sources lists being used in the container

If I change the Dockerfile to read

FROM debian:12.5
RUN echo "deb http://deb.debian.org/debian/ stable main contrib" > /etc/apt/sources.list && rm /etc/apt/sources.list.d/debian.sources
RUN apt update && apt install --no-install-recommends -y pbuilder

Then the package installs correctly

#1066021#10
Date:
2024-03-11 01:32:04 UTC
From:
To:
Adam Baxter dixit:
[…]

That autodetection has annoyed me multiple times in the past
already anyway, *and* it had overwritten parts of my custom
/etc/pbuilderrc, inserting an older mirror that it had cached
in debconf (which in itself is a violation).

Can we please just, in this day and age, skip that mirror
detection, and let pbuilder default to deb.debian.org if no
mirror variable is set in pbuilderrc? Drop all that fiddling
with the configuration files and everything.

Thanks,
//mirabilos

#1066021#15
Date:
2024-09-08 13:37:49 UTC
From:
To:
Another way to fix this is to set the config value manually.

Here is an example of what I did for ubuntu:

FROM ubuntu:noble
RUN echo "MIRRORSITE=http://archive.ubuntu.com/ubuntu" > /etc/pbuilderrc
RUN apt-get update && apt-get install -y pbuilder

Similar should work on Debian as well.
(does the Package line support multiple packages?)
Docker image
mirror
autodetect this
to insert some
container
/etc/apt/sources.list && rm /etc/apt/sources.list.d/debian.sources