在 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