Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install postgres on ubuntu without terminal prompts

I'm trying to get postgres to install on ubuntu xenial by automating the process entirely. I expected it would go smoothly like any other apt-get, but in the middle it asks me to configure where I'm from (region and city). However, I want it to get done without me actually having to type in more than the initial command. What I'm using so far is:

apt-get install -y postgresql

basically, I need it to input two values when the installation asks: 8 for region and 61 for city.

Since my knowledge of terminal commands is weak, I'd appreciate either simple and/or thoroughly explained suggestions

like image 400
ErikM Avatar asked Oct 20 '25 13:10

ErikM


1 Answers

Set the DEBIAN_FRONTEND environment variable to noninteractive. E.g., here's how to do it scoping to just the postgresql installation command:

DEBIAN_FRONTEND=noninteractive apt install -y postgresql
like image 125
Nikita Volkov Avatar answered Oct 22 '25 03:10

Nikita Volkov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!