Sunday, May 28, 2023
 Popular · Latest · Hot · Upcoming
342
rated 0 times [  342] [ 0]  / answers: 1 / hits: 180637  / 1 Month ago, thu, april 27, 2023, 4:01:32

I want to install certbot in a docker environment with an Ubuntu 16.04 image:



For example:



docker run -it ubuntu:16.04 /bin/bash


When I'm inside the container, the most straightforward way to install certbot does not work as it requires user intervention:



apt-get update && 
apt-get install -y software-properties-common &&
add-apt-repository -y -u ppa:certbot/certbot &&
apt-get install -y certbot


The problem is tzdata, which stops with this interactive dialog:



Extracting templates from packages: 100%
Preconfiguring packages ...
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:


Strangely enough, it works when I install tzdata before adding the ppa:



apt-get update && 
apt-get install -y tzdata &&
apt-get install -y software-properties-common &&
add-apt-repository -y -u ppa:certbot/certbot &&
apt-get install -y certbot


Questions:




  • Why makes it a difference whether I install tzdata before or after adding the ppa?

  • Is there a better approach for avoiding the interactive dialog when installing certbot?


More From » apt

 Answers
7

To run dpkg (behind other tools like Apt) without interactive dialogue, you can set one environment variable as



DEBIAN_FRONTEND=noninteractive


For example, you can set it in Dockerfile using ARG:



ARG DEBIAN_FRONTEND=noninteractive

[#11441] Friday, April 28, 2023, 1 Month  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inciplyies

Total Points: 10
Total Questions: 114
Total Answers: 93

Location: French Polynesia
Member since Sun, Dec 20, 2020
2 Years ago
;