下載安裝包,本文以二進制包方式安裝
https://www.postgresql.org/download/
Binary packages
- Red Hat family Linux (including CentOS/Fedora/Scientific/Oracle variants)
選擇適合的操作系統,會生成相對應的安裝命令。
- Select version:
11 - Select platform:
- Select architecture:
x86_64 - Install the repository RPM:
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- Install the client packages:
yum install postgresql11
- Optionally install the server packages:
yum install postgresql11-server
- Optionally initialize the database and enable automatic start:
/usr/pgsql-11/bin/postgresql-11-setup initdb systemctl enable postgresql-11 systemctl start postgresql-11