How to Install PostgreSQL on Ubuntu 18.04
Introduction
PostgreSQL is an open-source, object-relational database system with a strong reputation for feature robustness, extensibility, and technical standards compliance.
The latest version of this database system is PostgreSQL 12.1, while versions 11.6, 10.11, 9.6.16, 9.5.20, and 9.4.25 still get regular support updates.
PostgreSQL is one of the most famous open-source, freely available database management software systems out there. This system is quick, reliable, flexible, easy to use, and contains advanced features that allow complex applications to be built in a fault-tolerable workspace. There are two different packages of PostgreSQL, each intended for a specific purpose. The PostgreSQL Client package works on the client side to connect to servers, while the PostgreSQL Server package allows your system to set up and host your own databases. This tutorial will show you how to install these two packages and how to set up the PostgreSQL server in a few easy steps.
Install PostgreSQL from PostgreSQL Apt Repository
PostgreSQL is available in all Ubuntu versions by default, but it doesn’t guarantee automatic updates when new releases come out. The local repository only has "snapshots" of a specific version. The best practice is to install the software from the PostgreSQL Apt Repository.
The PostgreSQL Apt Repository provides the latest PostgreSQL version, as well as all previous server packages, extensions, and modules.
Step 1:
sudo apt-get install wget ca-certificates
Step 2 :
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Now add the repository to your system.
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
After adding the official PostgreSQL repository, make sure to update the package list. Doing this ensures you install the latest PostgreSQL package.
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
srinivasa@ubuntu:~/Desktop$ sudo su - postgres
Comments
Post a Comment