Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Install PostgreSQL Server With Yum on Linux

DZone's Guide to

How to Install PostgreSQL Server With Yum on Linux

This brief tutorial will get your PostgreSQL Server up and running on Linux distros by using Yum.

· Database Zone
Free Resource

Check out the IT Market Clock report for recommendations on how to consolidate and replace legacy databases. Brought to you in partnership with MariaDB.

If you have a Red Hat/CentOS/OracleLinux distro of Linux, then Yum should be available as your package manager. Here are the notes I have to get PostgreSQL server up running.

bash> yum info postgresql-server
bash> # Verify that's the version you want to install

bash> # Ready to install
bash> sudo su -
bash> yum -y install postgresql-server
bash> service postgresql initdb

bash> # Startup the server manually
bash> service postgresql start

bash> # Make server startup at system reboot
bash> chkconfig postgresql on

bash> # Verify postgres DB is working
bash> su - postgres -c psql
postgres=# \du
postgres=# \q

bash> # We are done, exit root user shell
bash> exit


If you can't find the service or chkconfig commands, then check to ensure you have /sbin in your $PATH.

Interested in reducing database costs by moving from Oracle Enterprise to open source subscription?  Read the total cost of ownership (TCO) analysis. Brought to you in partnership with MariaDB.

Topics:
server ,postgresql ,shell ,bash ,database ,yum

Published at DZone with permission of Zemian Deng, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}