Skip to content

Instantly share code, notes, and snippets.

@bborysenko
Created December 24, 2013 09:08
Show Gist options
  • Save bborysenko/8110648 to your computer and use it in GitHub Desktop.
Save bborysenko/8110648 to your computer and use it in GitHub Desktop.
Simple bash script to install PostgreSQL 9.3 on Centos 6
#!/usr/bin/env bash
if ! /bin/grep -q exclude=postgresql /etc/yum.repos.d/CentOS-Base.repo; then
sed -i -r '1,/\[extras\]/ s/KEY-CentOS-6/KEY-CentOS-6\nexclude=postgresql*/' /etc/yum.repos.d/CentOS-Base.repo
if ! [ -f /etc/yum.repos.d/pgdg-93-centos.repo ]; then
rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
fi
fi
yum install -y postgresql93-server
service postgresql-9.3 initdb
chkconfig postgresql-9.3 on
service postgresql-9.3 start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment