ペペロンチーノ街道

無知を晒す

apt install時のタイムゾーン選択で止まる問題

環境

Docker Ubuntu 20.04

概要

packageインストール時にタイムゾーン選択が要求される.このときコンソール通りに入力をしても応答がなくインストールが進まない.

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
  2. America     5. Arctic     8. Europe    11. SystemV
  3. Antarctica  6. Asia       9. Indian    12. US
Geographic area: 6 #ここから進まない

解決方法

環境変数DEBIAN_FRONTENDnoninteractiveに設定する. しばしばDockerfileで見かけるやつ.

ENV DEBIAN_FRONTEND=noninteractive

備考

ENV DEBIAN_FRONTENDについてはこの辺を参照.

5.2. ブートパラメータ

しかしながらDocker docsによると非推奨とのこと

While this may sound like a good idea, it may have side effects. The DEBIAN_FRONTEND environment variable is inherited by all images and containers built from your image, effectively changing their behavior. People using those images run into problems when installing software interactively, because installers do not show any dialog boxes.

Because of this, and because setting DEBIAN_FRONTEND to noninteractive is mainly a ‘cosmetic’ change, we discourage changing it.

Docker frequently asked questions (FAQ) | Docker Documentation

もしも利用する際はデフォルト値DEBIAN_FRONTEND=newtに戻しましょう.