Last active
June 2, 2020 20:00
-
-
Save defaye/59281bfdb9aaa367b7119ce962d5b5dc to your computer and use it in GitHub Desktop.
Install PostgreSQL 10 for local development on Ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To run this command in one line: