Difference between revisions of "Apt"

From PostgreSQL wiki
Jump to: navigation, search
(PostgreSQL packages for Debian and Ubuntu: 13 is stable)
(News: Add news for 13 release)
Line 50: Line 50:
* 2020-09-24: PostgreSQL 13 released
* 2020-07-13: Debian jessie and Ubuntu eoan are unsupported now
* 2020-07-13: Debian jessie and Ubuntu eoan are unsupported now
* 2020-05-04: arm64 added as new architecture: https://www.df7cb.de/blog/2020/arm64-on-apt.postgresql.org.html
* 2020-05-04: arm64 added as new architecture: https://www.df7cb.de/blog/2020/arm64-on-apt.postgresql.org.html

Revision as of 20:43, 9 October 2020

PostgreSQL packages for Debian and Ubuntu

The PostgreSQL Global Development Group (PGDG) maintains an APT repository of PostgreSQL packages for Debian and Ubuntu located at http://apt.postgresql.org/pub/repos/apt/. We aim at building PostgreSQL server packages as well as extensions and modules packages on several Debian/Ubuntu releases for all PostgreSQL versions supported.

Currently, we support

  • Debian 9 (stretch), 10 (buster), 11 (bullseye), and unstable (sid)
  • Ubuntu 16.04 (xenial), 18.04 (bionic), 20.04 (focal)
  • Architectures: amd64 (64-bit x86), i386 (32-bit x86, being phased out), arm64 (64-bit ARM), ppc64el (little-endian 64-bit POWER)
  • PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14 devel
  • Server extensions such as Slony-I, various PL languages, and datatypes
  • Applications like pgadmin4, omnidb, pgbouncer, and pgpool-II

Packages for older PostgreSQL versions and older Debian/Ubuntu distributions will continue to stay in the repository, but will in most cases not be updated anymore.


Import the repository key from https://www.postgresql.org/media/keys/ACCC4CF8.asc:

sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. In the example, replace buster with the actual distribution you are using:

deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main

(You may determine the codename of your distribution by running lsb_release -c). For a shorthand version of the above, presuming you are using a supported release:

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

Finally, update the package lists, and start installing packages:

sudo apt-get update
sudo apt-get install postgresql-11 pgadmin4

Alternately, this shell script will automate the repository setup. The script is included in the postgresql-common package in Debian and Ubuntu, so you can also run it straight from there:

sudo apt install postgresql-common
sudo sh /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

Note that the shell script leaves the source package repo (deb-src) commented out; if you need source packages, you will need to modify /etc/apt/sources.list.d/pgdg.list to enable it.

Have a look at the FAQ.

Note: This repository provides "postgresql", "postgresql-contrib", and "postgresql-client" meta-packages that depend on the latest postgresql-x.y, ... packages, similar to the ones present in Debian and Ubuntu. Once a new PostgreSQL version is released, these meta-packages will be updated to depend on the new version. If you rather want to stay with a particular PostgreSQL version, you should install specific packages like "postgresql-11" instead of "postgresql".

For packages of development/alpha/beta versions of PostgreSQL, see the FAQ entry about beta versions.


Older news items: Apt/OldNews



  • Mailing list: pgsql-pkg-debian@postgresql.org (Archives)
  • IRC channel: #postgresql-apt @ irc.freenode.net


  • Christoph Berg (credativ)
  • Marco Nenciarini (2ndQuadrant)
  • Michael Banck (credativ)

Past Contributors

  • Dimitri Fontaine
  • Magnus Hagander


Please report bugs:

  • on the pgsql-pkg-debian@postgresql.org mailing list, or
  • open an issue in Redmine, or
  • open a bug in the Debian BTS.



Work on setting up the archive was kindly supported by credativ, 2ndQuadrant, Redpill Linpro, and funding from the European Union's Seventh Framework Programme (FP7/2007-2013) under grant agreement 258862.

The amd64/i386 build servers are kindly hosted by DG-i and credativ.

The ARM build server is kindly hosted by HUAWEI Cloud Services.

The ppc64el build server is kindly hosted by IBM Power Systems Linux Center, Montpellier.

The repository is hosted on postgresql.org hardware.