bash 명령: 설치 중에 나중에 나타나는 메뉴 선택을 자동으로 입력하는 방법은 무엇입니까?

bash 명령: 설치 중에 나중에 나타나는 메뉴 선택을 자동으로 입력하는 방법은 무엇입니까?

Ubuntu 에서는 apt-get install -y python-catkin-tools"tzdata(2020f-0ubuntu0.18.04)"가 설치될 때 지역에 시간대 번호 8을, 도시에 7을 입력해야 합니다.

apt-get install -y python-catkin-tools나중에 팝업되는 메뉴 선택 항목이 처음에는 8이 표시되고 입력이 가능하자마자 7이 표시되도록 하려면 어떻게 실행해야 합니까 ? 입력할 숫자에 ##을 표시해 두었습니다.

apt-get install -y python-catkin-tools

...

Setting up tzdata (2020f-0ubuntu0.18.04) ...
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
Configuring tzdata
------------------

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  2. America  3. Antarctica  4. Australia  5. Arctic  6. Asia  7. Atlantic  8. Europe  9. Indian  10. Pacific  11. SystemV  12. US  13. Etc
Geographic area: ##8##

Please select the city or region corresponding to your time zone.

  1. Amsterdam  6. Belgrade    11. Budapest    [shortened...]

Time zone:


Time zone: ##7##

Current default time zone: 'Europe/Berlin'
Local time is now:      Wed Jan 20 22:42:43 CET 2021.
Universal Time is now:  Wed Jan 20 21:42:43 UTC 2021.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

설치 중에 사용자에게 시간대를 입력하지 않고 Dockerfile에서 자동으로 실행하려면 이것이 필요합니다. 여기에 올바른 시간대를 설치 명령의 매개변수로 입력하는 방법이나 단순한 해결 방법으로 기본 시간대를 사용하도록 강제하는 방법을 알고 싶습니다.

최근 실행 후 Dockerfile에서 설치하는 동안 숫자를 입력하는 것도 작동하지 않는 것 같습니다. 항목은 아무것도 트리거하지 않습니다.

[...]
Setting up tzdata (2021a-0ubuntu0.18.04) ...
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 tzdata
------------------

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: 8

7
^C

나는 이 문제가 apt-get이나 OS에만 국한된 것이 아니라고 가정하므로 태그를 지정하지 않습니다. 내가 틀렸다면 이것을 바꾸십시오.

답변1

Dockerfile을 빌드할 때는 이 방법이 작동하지 않습니다.

(외부 링크를 통해서도 시도해 볼 수 있습니다)

작업 메뉴를 살펴보고 메뉴에서 선택한 값을 수동으로 입력하려면 apt-get install -y gnome-terminal터미널 대화 상자를 표시하기 위해 "콘솔 설정"(예: gnome-terminal with )이 필요합니다. 하지만 이걸로 실행할 수는 없었습니다. 아마도 ssh필요할 수도 있습니다."프런트엔드를 초기화할 수 없습니다: SSH를 사용할 때 대화 상자"에 대한 답변, 이 경우 터미널(TERM)을 활성화하고 "대화 상자"를 프런트엔드로 사용한다는 의미입니다.

TERM=$TERM DEBIAN_FRONTEND=dialog apt-get install -y python-catkin-tools


Dockerfile을 빌드할 때 이는 저에게 효과적입니다.

정말로 메뉴 포인트를 입력하려는 경우 다음 해결 방법은 도움이 되지 않습니다. 기본값(이 경우 zone/city = "etc./etc.")에 문제가 없다면 해결 방법은 다음과 같습니다.Docker 아래에 설치할 때 대화 상자 질문에 대답할 수 있습니까?:

  1. apt-get install -y python-catkin-tools로 변경

    DEBIAN_FRONTEND=noninteractive apt-get install -y python-catkin-tools
    

바로 뒤에 오는 명령의 메뉴를 억제합니다.

  1. Dockerfile 설치 중에 메뉴를 표시하지 않고 시작 부분에 넣을 수도 있습니다.

    ARG DEBIAN_FRONTEND=noninteractive
    
  2. 이미지에서도 설정으로 유지되므로 입력하지 마세요.

    ENV DEBIAN_FRONTEND=noninteractive
    

나타나는 다른 모든 메뉴 항목을 억제하고 싶지 않을 수도 있으므로 기껏해야 "1."을 사용하십시오.

관련 정보