Installing PostgreSQL From A Yum Repository
Installing PostgreSQL From A Yum Repository
Table of Contents
Overview.....................................................................................................................................................3
Using the PostgreSQL repository from PostgreSQL.org.............................................................................3
Overview
A Linux repository is a storage location from which your system retrieves and installs OS updates and
applications. Each repository is a collection of software hosted on a remote server and intended to be
used for installing and updating software packages on Linux systems. When you run commands such as
“sudo apt update” or “sudo apt upgrade”, you may be pulling package information and package updates
from a number of repositories.
https://www.networkworld.com/article/3305810/how-to-list-repositories-on-linux.html
https://www.postgresql.org/download/linux/redhat/
Now select the right repo for your OS distribution and version of Linux. I am Running Centos 7 on 64-bit
machine.
So click on
You can also just right click on the link and select properties to then get the link.
cd /opt
wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-
latest.noarch.rpm
Take a look at the current repo files on your system before installing the rpm you just downloaded.
Now there should be a new repo file that should have been created from the installation we just did.
Notice the repo file pgdg-redhat-all.repo that was not there before the installation.
This file is basically like an address book where the yum program can look in to get addresses of the
repositories it needs to look in to browse and download software.
less /etc/yum.repos.d/pgdg-redhat-all.repo
Now search for and get ready to install version 9.6
Now query the rpm server package and get the name of the data directories, service name etc.
/usr/pgsql-9.6/bin/initdb -D /var/lib/pgsql/9.6/data
You can optionally start PostgreSQL server with