我以为我接受了 apt dist-upgrade 中的默认选项,但它仍然挂起

我以为我接受了 apt dist-upgrade 中的默认选项,但它仍然挂起

我正在尝试将kali-linux-defaultKali 元包安装到 docker 容器上而无需与其交互,但它仍提示我与其交互。

这是我的 Dockerfile:

FROM kalilinux/kali-rolling

# Run basic commands to update the image
RUN apt update
RUN apt dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
RUN apt autoremove -y
RUN apt clean -y
RUN apt install kali-linux-default -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"

但是,正如你在下面看到的,它要求我选择“是”或“否”

...
Setting up libnpth0:amd64 (1.6-3) ...
Setting up hdparm (9.58+ds-5) ...
Setting up libprotobuf23:amd64 (3.12.3-2+b2) ...
Setting up krb5-locales (1.18.3-4) ...
Setting up kismet-capture-common (2020.12.R3-0kali1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring kismet-capture-common
---------------------------------

Kismet needs root privileges for some of its functions. However, running it as
root ("sudo kismet") is not recommended, since running all of the code with
elevated privileges increases the risk of bugs doing system-wide damage.
Instead Kismet can be installed with the "setuid" bit set, which will allow it
to grant these privileges automatically to the processes that need them,
excluding the user interface and packet decoding parts.

Enabling this feature allows users in the "kismet" group to run Kismet (and
capture packets, change wireless card state, etc), so only thoroughly trusted
users should be granted membership of the group.

For more detailed information, see the Kismet 010-suid.md, which can be found
at "/usr/share/doc/kismet-doc/readme/010-suid.md" in kismet-doc package or
"https://www.kismetwireless.net/docs/readme/suid/".

Install Kismet "setuid root"? [yes/no] 

如果我选择“是”,那么我就能听到电脑风扇转动的声音,而且它永远不会继续。我猜这是因为 Kismet 试图提示用户与终端 GUI 进行交互,我相信我已经回忆过好几次了。

关于如何确实进入非交互式apt install进程?

答案1

需要在标志中添加额外的“q”。例如:

apt install -yqq

而不是

apt install -yq

添加第二个“q”后,问题就解决了。

相关内容