Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install PostgreSQL 10 for local development on Ubuntu 18.04
sudo apt update && sudo apt install -y postgresql-10 libpq-dev postgresql-contrib
sudo cp /etc/postgresql/10/main/pg_hba.conf /etc/postgresql/10/main/pg_hba.conf.backup
sudo sed -i -E "s/^(local\s+all\s+postgres\s+)peer$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo sed -i -E "s/^(local\s+all\s+all\s+)md5$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo sed -i -E "s/^(host\s+all\s+all\s+127\.0\.0\.1\/32\s+)md5$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo sed -i -E "s/^(host\s+all\s+all\s+::1\/128\s+)md5$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo service postgresql restart
@defaye

This comment has been minimized.

Copy link
Owner Author

defaye commented Jun 2, 2020

To run this command in one line:

curl -s https://gist.github.com/defaye/59281bfdb9aaa367b7119ce962d5b5dc/raw/6b18e3a9293c833bae20fb48854d42b1271fa434/install_postgresql.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.