4

I need to use the pg_basebackup/pg_dump program on an Ubuntu 18.04 system to connect to a remote PostgreSQL 11.6 server.

However, the current system only contains pg_basebackup 10.10 and the remote database is using PostgreSQL 11.6. Running pg_basebackup give the error

pg_basebackup: incompatible server version 11.6

Tried to install the correct version of pg_basebackup using the command:

apt install postgresql-client-11

but the apt package is not found. Only postgresql-client, postgresql-client-10 and postgresql-client-common are available the system's apt repos.

Question: How can we install the correct version of pg_basebackup without having to copy it over from the remote database server, and without installing PostgreSQL 11.6 on this machine?

8

Install it from PostgreSQL's own apt repository, adapted from these instructions.

sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt install postgresql-client-11
pg_basebackup -V

pg_basebackup (PostgreSQL) 11.7 (Ubuntu 11.7-1.pgdg18.04+1)

| improve this answer | |
  • 1
    This also works with version 12 (using sudo apt install postgresql-client-12) – user2726306 Jul 1 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.