在 Red Hat / Centos / Scientific Linux 上安裝
若需要 PostgreSQL 和 PostGIS 的最新二進位檔,可至 PostgreSQL 下載頁面 Redhat 衍生品 尋找。
- 選取 PostgreSQL 版本
- 選取「平台」和「結構」。
- 以 root 身分複製並執行設定指令碼。
此外,執行以下指令,以新增 PostGIS 和相依項。
# Install EPEL repo RPM:
dnf -y install epel-release
# Enable PowerTools repo (required for some of the dependencies):
dnf -y config-manager --set-enabled PowerTools
# you might need to do this instead for the Rockys
dnf config-manager --enable crb
# for Rocky 8 and above might need to do this as well
crb enable
# Now, you can finally install PostGIS
# Select the right PostGIS and PostgreSQL versions
dnf -y install postgis34_16
systemctl restart postgresql-16