Skip to content

Instantly share code, notes, and snippets.

@tacionery
Last active January 25, 2019 22:05
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save tacionery/5ffcbbfdd3fbc7ff9a276a3f827bd62a to your computer and use it in GitHub Desktop.
Save tacionery/5ffcbbfdd3fbc7ff9a276a3f827bd62a to your computer and use it in GitHub Desktop.
install postgresql on antergos
# uninstall postgresql if necessary
$ sudo pacman -R postgresql postgresql-libs
# remove postgres files
$ sudo rm -rfv /var/lib/postgres
# proceed with the installation
$ sudo pacman -S postgresql postgresql-libs
# setup password for postgres
$ sudo passwd postgres
# create this file
$ sudo vim /usr/lib/systemd/system/rc-local.service
# paste this
[Unit]
Description=/etc/rc.local compatibility
[Service]
Type=oneshot
ExecStart=/etc/rc.local
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
# now create this file
sudo vim /etc/rc.local
# and paste this
#!/bin/sh -e
#
# rc.local
exit 0
# make the /etc/rc.local executable
$ sudo chmod +x /etc/rc.local
# enable the rc.local.service
sudo systemctl enable rc-local.service
# now log in with postgres user
$ sudo su - postgres
# init the database
$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'
$ exit
# now start postgresql service
$ sudo systemctl start postgresql.service
# so, that's what i did to install and configure postgresql on my antergos linux
# hope it helps
@oziey88
Copy link

oziey88 commented Apr 15, 2017

thanks its very helpful
and i ask to repost(translate to my language) this for my blog with source link to this page.

@jlouiss
Copy link

jlouiss commented Jan 18, 2018

Thank you very much.
I saved lots of hours of searching thanks to you

@TVinterfrost
Copy link

This is great!
Thanks!

@AntonRich
Copy link

Thank you Sir. All is good.

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