PostgreSQL is available in all Ubuntu versions by default. However, Ubuntu "snapshots" a specific version of PostgreSQL that is then supported throughout the lifetime of that Ubuntu version. Other versions of PostgreSQL are available through the PostgreSQL apt repository.
Ubuntu includes PostgreSQL by default. To install PostgreSQL on Ubuntu, use the apt-get (or other apt-driving) command:
apt-get install postgresql-9.4
The repository contains many different packages including third party addons. The most common and important packages are (substitute the version number as required):
If the version included in your version of Ubuntu 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 LTS versions of Ubuntu (12.04, 14.04 and 16.04) on amd64 and i386 architectures as well as select non-LTS versions(15.10). While not fully supported, the packages often work on other non-LTS versions as well, by using the closest LTS version available.
To use the apt repository, follow these steps:
deb http://apt.postgresql.org/pub/repos/apt/ YOUR_UBUNTU_VERSION_HERE-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update
For more information about the apt repository, including answers to frequent questions, please see the apt page on the wiki.
Generic RPM and DEB packages that provide a server-only distribution are avaliable for some 32 and 64-bit Linux distributions. These packages provide a single set of binaries and consistent packaging across different Linux distributions. They are designed for server installation where a GUI is not available and consistency across multiple distributions is a requirement.
Download the packages from OpenSCG for all supported versions.
Note: The cross distribution packages do not fully integrate with the platform-specific packaging systems.
Installers are available for 32 and 64-bit Linux distributions and include PostgreSQL, pgAdmin and the StackBuilder utility for installation of additional packages.
Download the installer from EnterpriseDB for all supported versions.
Note: The installers do not integrate with platform-specific packaging systems.