Install PostgreSQL on Debian

PostgreSQL is available in all Debian versions by default. However, the stable versions of Debian's "snapshot" a specific version of PostgreSQL that is then supported throughout the lifetime of that Debian version. The PostgreSQL project also maintains an apt repository with all supported of PostgreSQL available.

PostgreSQL Apt Repository

If the version included in your version of Debian is not the one you want, you can use the PostgreSQL Apt Repository. This repository will integrate with your normal systems and patch management, and provide automatic updates for all supported versions of PostgreSQL throughout the support lifetime of PostgreSQL.

The PostgreSQL apt repository supports the currently supported stable versions of Debian:

    Buster (10.x)
    Stretch (9.x)
    Jessie (8.x)
    Bullseye (11.x, testing)
    Sid (unstable)

on the following architectures:

    amd64
    arm64 (Buster and newer)
    i386 (Buster and older)
    ppc64el

To use the apt repository, follow these steps:

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

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

sudo apt install postgresql

If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':

sudo apt install postgresql-12

Reference:
https://www.postgresql.org/download/linux/debian/

0 Komentar