Saturday, July 8, 2023

Install PostgreSQL 14 di Linux berbasis Ubuntu


Step 1 – Install PostgreSQL 14 on Debian 11 | Debian 10

PostgreSQL is available in the default Debian repositories but the available versions are not up to date. Check the available versions using the command:

sudo apt-cache search postgresql | grep postgresql

In this guide, we are interested in PostgreSQL 14 which is not provided in the default repositories. Therefore, we are required to add a repository that provides the package.

sudo sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Import the GPG key for the added repository.

wget --quiet -O - | sudo apt-key add -

Next, update your APT package index.

sudo apt -y update

Tulisan ini saya copy dari sumber website:

Langkah yang dilakukan adalah sebagai berikut:

Now install PostgreSQL 14 on Debian 11/Debian 10 using the command below.

sudo apt install postgresql-14

Verify your PostgreSQL 14 installation as below.

$ sudo -u postgres psql -c "SELECT version();"
 PostgreSQL 14.8 (Debian 14.8-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

With a complete installation, PostgreSQL 14 will be initialized. Check the status of the service as below. 

$ systemctl status postgresql    


Previous Post
Next Post