centos7 离线安装postgis步骤
时间: 2023-09-30 21:04:35 浏览: 55
以下是CentOS 7离线安装PostGIS的步骤:
1.下载PostGIS软件包
从PostGIS官网(https://postgis.net/source/)或其他可靠的网站下载PostGIS软件包。选择与您的系统和PostgreSQL版本兼容的版本。
2.将软件包复制到CentOS 7服务器
使用SCP或其他文件传输工具将PostGIS软件包复制到CentOS 7服务器。
3.安装PostGIS依赖项
在离线模式下安装PostGIS需要先安装以下依赖项:
sudo yum install -y gcc gcc-c++ make automake autoconf libtool libxml2-devel libgeos-devel proj-devel json-c-devel gdal-devel
4.解压缩PostGIS软件包
使用以下命令解压缩PostGIS软件包:
tar xzf postgis-[version].tar.gz
5.编译和安装PostGIS
进入解压缩的PostGIS目录并运行以下命令:
./configure
make
sudo make install
6.在PostgreSQL中启用PostGIS扩展
在PostgreSQL中启用PostGIS扩展需要在pgAdmin或命令行中运行以下命令:
CREATE EXTENSION postgis;
7.验证安装
使用以下命令验证PostGIS是否已成功安装:
SELECT PostGIS_version();
如果PostGIS已成功安装,则会返回PostGIS版本号。
以上就是CentOS 7离线安装PostGIS的全部步骤。