2 Install_PostgreSQL_13_and_PostGIS_3
Kaimbacher edited this page 2021-07-21 14:38:46 +00:00

Install PostgreSQL 13 on Ubuntu 20.04/18.04

see also:
https://computingforgeeks.com/install-postgresql-12-on-ubuntu/

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - response:
OK

echo "deb http://apt.postgresql.org/pub/repos/apt/ lsb_release -cs-pgdg main" |sudo tee /etc/apt/sources.list.d/pgdg.list response:
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main \

(dieses Repository hat aktuellere postgres 12 Versionen, deswegen upgraden: \

sudo apt update
sudo apt list --upgradable
sudo apt update

sudo apt install postgresql postgresql-contrib

the following additional packages will be installed: libcommon-sense-perl libjson-perl libjson-xs-perl libllvm9 libtypes-serialiser-perl pgdg-keyring postgresql-13 postgresql-client-13 postgresql-client-common postgresql-common sysstat Suggested packages: postgresql-doc postgresql-doc-13 isag The following NEW packages will be installed: libcommon-sense-perl libjson-perl libjson-xs-perl libllvm9 libtypes-serialiser-perl pgdg-keyring postgresql postgresql-13 postgresql-client-13 postgresql-client-common postgresql-common postgresql-contrib sysstat 0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded. Need to get 32.5 MB of archives. After this operation, 128 MB of additional disk space will be used.

response:
the database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english". \

Data page checksums are disabled. \

fixing permissions on existing directory /var/lib/postgresql/13/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok \

Success. You can now start the database server using:
pg_ctlcluster 13 main start \

Ver Cluster Port Status Owner Data directory Log file
13 main 5432 down postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log \

While in terminal, log in to the psql console as postgres user:

sudo -u postgres psql
\q

Install PostGIS on Ubuntu 20.04/18.04

see also: https://www.igismap.com/install-postgis-postgresql-ubuntu/
PostGIS installieren:
sudo apt install postgresql-13-postgis-3 postgresql-13-postgis-3-scripts

to get the commandline tools shp2pgsql, raster2pgsql you need to do this:
sudo apt install postgis

response: The following additional packages will be installed:
postgis-doc
The following NEW packages will be installed:
postgis postgis-doc
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.

Install pgadmin4 desktop

sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'
sudo apt update

sudo apt install pgadmin4-desktop

The following additional packages will be installed:
  libfile-basedir-perl libfile-desktopentry-perl libfile-mimeinfo-perl
  libio-stringy-perl libipc-system-simple-perl libnet-dbus-perl
  libtie-ixhash-perl libx11-protocol-perl libxml-parser-perl libxml-twig-perl
  libxml-xpathengine-perl pgadmin4-server xdg-utils