Quickstart
Import the repository key from https://www.postgresql.org/media/keys/ACCC4CF8.asc:
sudo apt install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg –dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
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. File contents:
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 script version of the above file creation, 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 update
sudo apt install postgresql-15
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.
Свежие комментарии