PostGISのインストール

AlmaLinuxへのPostGISのインストール。標準のPostgreSQLを使わない。PostGIS3.1、PostgreSQL14。

  1. PGDGレポジトリの登録
    dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
  2. 標準のPostgreSQLの無効化
    dnf -qy module disable postgresql
  3. EPELレポジトリの登録
    dnf -y install epel-release
  4. PowerToolsの有効化
    dnf -y config-manager –set-enabled powertools
  5. PostGISのインストール
    dnf -y install postgis31_14
  6. データベースにPostGIS拡張を作成
    psql -d yourdatabase -c “CREATE EXTENSION postgis;”

参考ページ:Installing PostGIS 3.1 and PostgreSQL 13 on CentOS 8

追記:shp2pgsqlは別途インストールが必要。

dnf -y install postgis31_14-client