Guide for Manual Download and Install of Postgres12 Offline
Postgresql is one of the Tamr dependencies. It must be installed and turned on before Tamr itself is installed. This article describes how to install Postgres12 on Ubuntu 18 when the server is unable to connect to the internet to fetch packages.
- Download postgresql-12 debian files from a computer with internet access and then, transfer the files into the VM, then install.
- After downloading and installing postgresql-12 debian files, one must create a folder and put all the debian files in the folder. The debian files can be found on the Ubuntu Website.
The list of Ubuntu 18 Postgres12 required files includes:
- pgdg-keyring_2018.2_all.deb
- postgresql-client-common_231.pgdg18.04+1_all.deb
- libpq5_14.0-1.pgdg18.04+1_amd64.deb
- libllvm9_9-2~ubuntu18.04.2_amd64.deb
- ssl-cert_1.0.39_all.deb
- postgresql-common_231.pgdg18.04+1_all.deb
- postgresql-client-12_12.8-1.pgdg18.04+1_amd64.deb
- postgresql-12_12.8-1.pgdg18.04+1_amd64.deb
- Then run the command
sudo dpkg -i *
in the folder
Note that, in case it runs into an error with a missing dependency or wrong version for dependency, download and add the dependency into the same folder, then rerun the above command. Repeat the process until all packages are installed without an error. It may take users a couple of rounds until all required packages are installed depending on what packages the system already has installed.
- Once it is set up, make sure the owner and group of the folder
/var/lib/postgresql/12/main
and all the files in this folder are “postgres”.
To check the owner and group of a folder, run:
ls -l /var/lib/postgresql/12/main
The third and fourth columns of the output show the owner and group.
If it is not postgres, change them to postgres (may need to run with “sudo” for permission):
For the folder, chown -R postgres:postgres /var/lib/postgresql/12/main
- Once the owner and group are verified “postgres”, refer to Tamr Docs on Installing PostgresSQL 12 on Ubuntu 18 and run:
sudo service postgresql start
- Once Postgresql is running appropriately, the port 5432 should listen.
To check opening ports:
sudo lsof -i -P -n | grep LISTEN
OR: service postgresql status
will return a message:
12/main (port 5432): online
- After the above checks, create the database based on instructions from Tamr Docs on Installing PostgresSQL 12 on Ubuntu 18.
Some other useful commands need for debugging:
Check if postgresql has started correctly without error:
sudo nano /var/log/postgresql/postgresql-12-main.log
Check the status of postgresql:
systemctl status postgresql
Restart postgresql:
systemctl restart postgresql
Updated over 2 years ago