PostGISをインストールする!(Ubuntu Server 22.04)

Ubuntu Server 22.04に、PostGISをインストールします。

使用する環境を確認する!

使用する環境を確認します。

$ hostnamectl
 Static hostname: vmsgis11
       Icon name: computer-vm
         Chassis: vm
      Machine ID: e18a27fbe8ac4dbcb89641f30b005d2e
         Boot ID: 87db6f30005f4714b4b29aeb109bdc4d
  Virtualization: oracle
Operating System: Ubuntu 22.04.3 LTS              
          Kernel: Linux 5.15.0-84-generic
    Architecture: x86-64
 Hardware Vendor: innotek GmbH
  Hardware Model: VirtualBox

PostgreSQLをインストールする!

標準のリポジトリからPostgreSQLをインストールします。

$ sudo apt install postgresql
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libcommon-sense-perl libjson-perl libjson-xs-perl libllvm14 libpq5 libsensors-config libsensors5
  libtypes-serialiser-perl postgresql-14 postgresql-client-14 postgresql-client-common postgresql-common ssl-cert
  sysstat
Suggested packages:
  lm-sensors postgresql-doc postgresql-doc-14 isag
The following NEW packages will be installed:
  libcommon-sense-perl libjson-perl libjson-xs-perl libllvm14 libpq5 libsensors-config libsensors5
  libtypes-serialiser-perl postgresql postgresql-14 postgresql-client-14 postgresql-client-common postgresql-common
  ssl-cert sysstat
0 upgraded, 15 newly installed, 0 to remove and 3 not upgraded.
Need to get 42.4 MB of archives.
After this operation, 161 MB of additional disk space will be used.
...

PostGISをインストールする!

標準のリポジトリからPostGISをインストールします。

$ sudo apt install postgis
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core gdal-data libaec0 libaom3 libarmadillo10 libarpack2 libblas3 libblosc1
  libboost-serialization1.74.0 libcfitsio9 libcharls2 libdav1d5 libde265-0 libdeflate0 libfontconfig1 libfreexl1
  libfyba0 libgdal30 libgeos-c1v5 libgeos3.10.2 libgeotiff5 libgfortran5 libgif7 libgmpxx4ldbl libhdf4-0-alt
  libhdf5-103-1 libhdf5-hl-100 libheif1 libjbig0 libjpeg-turbo8 libjpeg8 libkmlbase1 libkmldom1 libkmlengine1
  liblapack3 liblcms2-2 libltdl7 libminizip1 libmysqlclient21 libnetcdf19 libodbc2 libodbcinst2 libogdi4.1
  libopenjp2-7 libpoppler118 libproj22 libprotobuf-c1 libqhull-r8.0 libquadmath0 librttopo1 libsfcgal1 libsnappy1v5
  libspatialite7 libsuperlu5 libsz2 libtiff5 liburiparser1 libwebp7 libx265-199 libxerces-c3.2 mysql-common
  poppler-data postgis-doc postgresql-14-postgis-3 postgresql-14-postgis-3-scripts proj-bin proj-data unixodbc-common
Suggested packages:
  geotiff-bin gdal-bin libgeotiff-epsg libhdf4-doc libhdf4-alt-dev hdf4-tools liblcms2-utils odbc-postgresql tdsodbc
  ogdi-bin poppler-utils ghostscript fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic
  | fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming fonts-nanum
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core gdal-data libaec0 libaom3 libarmadillo10 libarpack2 libblas3 libblosc1
  libboost-serialization1.74.0 libcfitsio9 libcharls2 libdav1d5 libde265-0 libdeflate0 libfontconfig1 libfreexl1
  libfyba0 libgdal30 libgeos-c1v5 libgeos3.10.2 libgeotiff5 libgfortran5 libgif7 libgmpxx4ldbl libhdf4-0-alt
  libhdf5-103-1 libhdf5-hl-100 libheif1 libjbig0 libjpeg-turbo8 libjpeg8 libkmlbase1 libkmldom1 libkmlengine1
  liblapack3 liblcms2-2 libltdl7 libminizip1 libmysqlclient21 libnetcdf19 libodbc2 libodbcinst2 libogdi4.1
  libopenjp2-7 libpoppler118 libproj22 libprotobuf-c1 libqhull-r8.0 libquadmath0 librttopo1 libsfcgal1 libsnappy1v5
  libspatialite7 libsuperlu5 libsz2 libtiff5 liburiparser1 libwebp7 libx265-199 libxerces-c3.2 mysql-common
  poppler-data postgis postgis-doc postgresql-14-postgis-3 postgresql-14-postgis-3-scripts proj-bin proj-data
  unixodbc-common
0 upgraded, 70 newly installed, 0 to remove and 3 not upgraded.
Need to get 52.5 MB of archives.
After this operation, 215 MB of additional disk space will be used.
...

おわりに

Ubuntu Server 22.04を使用すると、標準のリポジトリから容易にPostGISをインストールすることができます。

関連記事