LoginSignup
65
54

More than 5 years have passed since last update.

"debconf: delaying package configuration, since apt-utils is not installed"を表示しないようにする

Posted at

DockerイメージをビルドするときにRUN apt-getするステップでタイトルにある警告が表示される。
何かが遅れるだけ(?)で害はなさそうだが、目立つのでなんとか表示しないようにできないか、調べた。

メッセージを見て、先にapt-utilsをインストールしてやればよいのかと思い試したが、このパッケージ自体のインストール時に警告が表示されてしまう。しかも以下のような別の警告も表示されるようになった。

debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 

ここを見つけ、以下のように環境変数を設定すればこの警告は表示されなくなった。

ENV DEBIAN_FRONTEND noninteractive

元々気になっていた警告を表示しなくするために、何かしらの環境変数が効くのではと思い、debconf environment variablesで検索したらubuntu manualsがヒットした。参考にして、以下の設定をしたら当初の警告も表示されなくなった。

ENV DEBCONF_NOWARNINGS yes

apt-utilsをインストールしなくても警告が表示されなくなったので、Dockerイメージを少しでも小さくするためにインストールの対象から除いた。

今回のもの以外に、知らないうちに表示されなくなる警告があるのだろうが、、、、まあいいや。

65
54
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
65
54