Skip to content

Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link
Owner Author

defaye commented Jun 2, 2020

To run this command in one line:

curl -s | 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.