Skip to content

Instantly share code, notes, and snippets.

@bradrydzewski
Created June 18, 2014 16:26
Show Gist options
  • Save bradrydzewski/f10e71394a694fca307f to your computer and use it in GitHub Desktop.
Save bradrydzewski/f10e71394a694fca307f to your computer and use it in GitHub Desktop.
Install Postgres 9.3
#!/bin/bash
# remove existing 9.1 installation
sudo /etc/init.d/postgresql stop
sudo apt-get --force-yes -fuy remove --purge postgresql postgresql-9.1 postgresql-client
# install 9.3
sudo apt-get install python-software-properties
sudo add-apt-repository 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main'
sudo apt-get update
sudo apt-get install -y postgresql-9.3
# update the postgres config files
sudo /bin/bash -c "cat <<EOF > /etc/postgresql/9.3/main/pg_hba.conf
local all postgres trust
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
EOF"
# restart
sudo /etc/init.d/postgresql restart
@bradrydzewski
Copy link
Author

Add this command to your build script to install Postgres 9.3

curl --silent https://gist.githubusercontent.com/bradrydzewski/f10e71394a694fca307f/raw/d60108a3e0542d3bc15f301ae81c014bdae2056b/install.sh | /bin/bash -s 1> /dev/null 2> /dev/null

@mraxus
Copy link

mraxus commented Jun 19, 2014

Thank you sir! It works like a charm =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment