M

sa
mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.4 kB
1
Indexable
Never
#Installation of all the packages needed for MobilityDB.
#Software installed: Postgres13, PostGis3, MobilityDB, PgAdmin, 
#I think that you can easily install other versions of Postgres, simply #changing the relative number in the commands (e.g. 
#"sudo apt install postgresql-14" and "sudo apt install postgis #postgresql-14-postgis-3"
----------------------------------------------------------------
#Ubuntu version (at installation time)
Release: 22.04
Codename: jammy
----------------------------------------------------------------
#Virtualbox configuration (for a better experience)
Base memory: 4096MB
Processors: 4
----------------------------------------------------------------
#Add the following package repository to the sources.list
sudo gedit /etc/apt/sources.list
# and add the following line
deb [trusted=yes] http://cz.archive.ubuntu.com/ubuntu jammy main universe restricted multiverse
deb [trusted=yes] http://cz.archive.ubuntu.com/ubuntu bionic main universe
 ----------------------------------------------------------------
#Update the system
sudo apt update
sudo apt -y upgrade
sudo apt autoremove
----------------------------------------------------------------
#Install git
sudo apt -y install git
----------------------------------------------------------------
#Install build essential services and cmake
sudo apt -y install build-essential cmake
#or to install "cmake" you can use snap
sudo snap cmake --classic
----------------------------------------------------------------
#Install Postgres-13
sudo apt install curl ca-certificates gnupg

curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

sudo apt update

sudo apt install postgresql-13

#--set the postgres user password
sudo -u postgres psql
\password postgres
----------------------------------------------------------------
#Install Postgis-3 (for Postgres-13)
sudo apt install postgis postgresql-13-postgis-3 postgresql-13-postgis-3-scripts
----------------------------------------------------------------
#Install JSONC
sudo apt install libjson-c-dev libjson-c-doc libjson-c5
----------------------------------------------------------------
#Install GEOS
sudo apt-get install gsl-bin libgsl-dev
sudo apt -y install geos-bin libgeos++-dev libgeos-c1v5 libgeos-dev libgeos-doc libgeos3.10.2
----------------------------------------------------------------
#Fix broken
sudo apt --fix-broken install
----------------------------------------------------------------
#Install dev files
sudo apt install postgresql-server-dev-13 liblwgeom-dev libproj-dev libjson-c-dev libprotobuf-c-dev 
----------------------------------------------------------------
#Modify posgres config file
#--find the path of the config file
sudo -u postgres psql
SHOW config_file;
#--modify it
sudo gedit /etc/postgresql/13/main/postgresql.conf
#edit the following lines
shared_preload_libraries = 'postgis-3'
max_locks_per_transaction = 128
----------------------------------------------------------------
#Download and install MobilityDB 
git clone https://github.com/MobilityDB/MobilityDB
mkdir MobilityDB/build
cd MobilityDB/build
cmake ..
make
sudo make install
----------------------------------------------------------------
#Install pgAdmin4 (desktop-mode)
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 && apt update'
sudo apt install pgadmin4-desktop
----------------------------------------------------------------
#Create postgis and mobilitydb extensions (in a postgres database)
CREATE EXTENSION PostGIS;
CREATE EXTENSION MobilityDB;
----------------------------------------------------------------
#Install QGis
sudo apt install gnupg software-properties-common

wget -qO - https://qgis.org/downloads/qgis-2021.gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import

sudo chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg

sudo add-apt-repository "deb https://qgis.org/ubuntu $(lsb_release -c -s) main"