PostgreSQL is easy to install online, but in many cases the server is not networked and needs to be installed offline. Here are the steps to install offline:
1. First enter the official website:
https://www.postgresql.org/
2. Click Download
3. Select the desired operating system version
4. Select the desired version
5. Download the Yum source on a network-capable machine
Yum Install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-3.noarch.rpm
6. Download Postgres software
Yum Search Postgres
mkdir psql95
Yum install--downloadonly--downloaddir=psql95 postgresql95 postgresql95-server
7. View the downloaded package
# ls
postgresql95-9.5.13-1pgdg.rhel6.x86_64.rpm
postgresql95-libs-9.5.13-1pgdg.rhel6.x86_64.rpm
postgresql95-server-9.5.13-1pgdg.rhel6.x86_64.rpm
8. Package and transfer to an offline server that needs to be installed
# TAR-ZCVF Pg.tar.gz *
postgresql95-9.5.13-1pgdg.rhel6.x86_64.rpm
postgresql95-libs-9.5.13-1pgdg.rhel6.x86_64.rpm
postgresql95-server-9.5.13-1pgdg.rhel6.x86_64.rpm
9. In the need of installation side decompression, installation
RPM-IVH postgresql95-*
10. Start
# service postgresql-9.5 Initdb
# service postgresql-9.5 Start
# Chkconfig postgresql-9.5 on
11. Connecting Postgres
Su-postgres
Psql
postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+---------- +-------------+-------------+----------------------- postgres | postgres | utf8 | en_us. Utf-8 | en_us. utf-8 | template0 | postgres | utf8 | en _us. Utf-8 | en_us. utf-8 | =c/postgres + | | | | | postgres=ctc/postgres template1 | postgres | utf8 | en_us. Utf-8 | en_us. utf-8 | =c/postgres + | | | | | postgres=ctc/ Postgres (3 rows)
At this point, the offline installation is complete.
Offline installation of PostgreSQL