Centos使用yum安装Postgresql11和PostGIS 3及pgrouting3.1.2

本文详细介绍如何在CentOS上通过yum工具安装PostgreSQL 11版本,搭配PostGIS 3.0和pgrouting 3.1.2,包括添加官方源、检查安装包、配置与连接数据库等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Centos使用yum安装Postgresql11和PostGIS 3及pgrouting3.1.2
一、三者版本必须对应。
Postgresql与PostGIS版本对应参考官网说明,地址如下:
1、https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS
2、pgrouting与Postgresql版本对应参考官网说明,在各版本帮助文档中安装说明中地址如下:https://docs.pgrouting.org/2.5/en/pgRouting-installation.html#get-the-sources (中Dependencies)但yum安装命令为:yum install pgrouting_11(11是装的postgresql的版本),所以yum安装知道postgresql的版本就行。
具体安装详细见官网:https://github.com/pgRouting/pgrouting/wiki/Notes-on-Download%2C-Installation-and-building-pgRouting
二、添加PostgreSQL、PostGIS、pgrouting的官方源(对yum安装这步可以忽略)
1、PostgreSQL的官方源参考 https://download.postgresql.org/pub/repos/yum/
2、PostGIS的官方源参考  http://download.osgeo.org/postgis/source/
3、pgrouting官方源参考https://koji.fedoraproject.org/koji/packageinfo?packageID=11212
三、检查PostgreSQL、PostGIS、pgrouting可用的安装包
yum list PostgreSQL
yum list PostGIS
yum list pgrouting
如果没有检测到可用的安装包,则安装EPEL的repository 之后再试
yum install https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
如果还没有检测到可用的安装包,可添加PostgreSQL的官方源之后再试
rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
四、安装
1、安装Postgres 11数据库与客户端
yum install postgresql11-server postgresql11 -y
2、安装PostGIS
yum install postgis30_11
3、安装pgrouting
yum install pgrouting_11
五、创建数据库
1、初始化数据库
/usr/pgsql-11/bin/postgresql-11-setup initdb
2、启用数据库的服务
systemctl enable postgresql-11.service
systemctl start postgresql-11.service
六、配置、设置、连接数据库
在上述安装过程完成后,默认的数据库没有登陆密码,而且不允许远程用户登录。因此需要配置远程登录与设置Postgres用户的登陆密码。
具体参考以下文章:https://blog.csdn.net/cwr888/article/details/117771164

其它有用资源备注:
1、windowspostgresql+postgis+pgrouting安装步骤图解
https://www.cnblogs.com/ytwy/p/6817179.html
https://www.cnblogs.com/ejQiu-123/p/11353847.html
2、pgRouting 路径分析功能使用-pgrouting最优路径规划之一
https://blog.csdn.net/u014529917/article/details/72866436
https://zhuanlan.zhihu.com/p/150125156
https://docs.pgrouting.org/3.0/en/index.html
3、PostGIS postgresql12安装postgis/mysql_fdw/pgrouting
https://blog.csdn.net/guzicheng1990/article/details/104615409
4、postgresql+pgrouting 最短路线sql
https://www.giserdqy.com/database/postgresql/25955/
5、Linux(CentOS)下RPM包安装、yum 安装、源码包安装PostgreSQL数据库参考地址
https://blog.csdn.net/enweitech/article/details/49096029, RPM包查找地址https://pkgs.org/,Search the RPM repository on rpmfind.net,Build System Info | koji,centos7系统下postgresql12离线安装_uvwxyzhao的博客-CSDN博客
6、Linux(CentOS)下源码包安装PostgreSQL、PostGis、pgRouting数据库参考地址
https://zhuanlan.zhihu.com/p/81814954
https://zhuanlan.zhihu.com/p/82098919
https://zhuanlan.zhihu.com/p/82405507
7、安装后版本查看
show server_version
SELECT PostGIS_full_version();
select pgr_version();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值