嘗試在 Debian 9 容器中使用taskel 安裝軟體包時出錯

嘗試在 Debian 9 容器中使用taskel 安裝軟體包時出錯

我正在運行 Docker 桌面社群 2.0.3。我從 docker hub (hub.docker.com) 運行官方 nginx 和 Apache HTTP 伺服器容器。容器鏡像是基於Debian 9。我使用以下命令在容器中打開了一個終端機:

docker exec -ti container_id bash

我嘗試執行tasksel安裝

# tasksel install standard
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 76.)
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.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Installing packages
-------------------

..100%

問題是:

  • 它不會開啟任務集 TUI(文字使用者介面),如螢幕截圖所示。
  • 我收到上述錯誤,但安裝未完成。

Docker桌面安裝在macOS 10.12上

塔塞爾

答案1

要使用tasksel,需要安裝dialog;在你的容器中:

apt update && apt install -y dialog tasksel

然後

tasksel install standard

可以使用通常的介面。

您不需要傳入TERM變數。

許多標準實用程式在容器中沒有多大用處,但是如果我要這樣做,我會使用aptitude而不是tasksel

apt update && apt install -y aptitude && \
aptitude install -y ~pstandard ~prequired ~pimportant

答案2

結果 ncurses 需要這個指令: https://stackoverflow.com/a/38774123/3341782 不確定是否有更好的解決方案。

相關內容