PostgreSQL and PostGIS are installed in two main ways, from source installation and package management tool installation, recommended to install with package management tools, the following is the specific steps installed on the CentOS 7.1 X64
- Install Yum repository.
The repository of PGDG (PostgreSQL Global development Group) is recommended, and this repository includes the official latest PostgreSQL and matching PostGIS, Use a different repository without the latest or no matching PostGIS.
Find the appropriate operating system repository RPM on the link page below
http://yum.postgresql.org/repopackages.php
Installing with the RPM tool
- Check for available installation packages
As you can see from the output, there are only 9.2 of the CentOS default repository, 9.4 PostgreSQL and PostGIS in PGDG repository
- Installing PostgreSQL
Yum install postgresql94.x86_64 postgresql94-server.x86_64 postgresql94-libs.x86_64 postgresql94-contrib.x86_64 Postgresql94-devel.x86_64
- Installing PostGIS
Will report a bunch of dependency errors.
Need to install Epel's repository
Re-run Yum installation PostGIS
- Installation Complete
The installation of PostgreSQL and PostGIS on CentOS