#1030232 apt-get install -y should use noninteractive debconf frontend

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Christian
Date:
2023-02-01 13:18:06 UTC
Severity:
normal
#1030232#5
Date:
2023-02-01 12:28:28 UTC
From:
To:
Dear Maintainer,

When I install a package with the -y flag, according to the man page should give me a noninteractive mode. However, it still uses the Dialog frontend. See the following output:

root@8a97f9bba510:/# apt-get install -y exim4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  exim4
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 7582 B of archives.
After this operation, 27.6 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 exim4 all 4.95-4ubuntu2.2 [7582 B]
Fetched 7582 B in 0s (45.4 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package exim4.
(Reading database ... 100691 files and directories currently installed.)
Preparing to unpack .../exim4_4.95-4ubuntu2.2_all.deb ...
Unpacking exim4 (4.95-4ubuntu2.2) ...
Setting up exim4 (4.95-4ubuntu2.2) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
root@8a97f9bba510:/#

A workaround is to run "DEBIAN_FRONTEND=noninteractive apt-get install exim4" instead.

Reported from Ubuntu 22.04 but the Debian package is affected as well.

#1030232#10
Date:
2023-02-01 13:00:28 UTC
From:
To:
We should fix the manual page because -y does not work for all prompts,
luckily, but also debconf is not part of apt so like other hooks it
can prompt on its own.

Setting the noninteractive frontend if you pass -y would be wrong, the
questions may be very important. Just like it would be wrong for -y to
answer y to installing unauthenticated packages, removing essentail
packages and so on.

#1030232#15
Date:
2023-02-01 13:14:55 UTC
From:
To:
following additional packages will be installed:" "Do you want to
continue?" ?

Perhaps the documentation could be worded:
        -y, --yes, --assume-yes
            Run non-interactively, assuming "yes" as answer to
unimportant questions. Abort
            in undesirable situations, such as changing a held
            package, trying to install an unauthenticated package or
removing an essential
            package. Does not affect prompts generated by hooks such as
debconf.
            Configuration Item:   APT::Get::Assume-Yes.