snippetsqlMajor
How to Install postgresql-client-11 on Ubuntu 18.04
Viewed 0 times
postgresqlinstallubuntuclienthow
Problem
I need to use the
However, the current system only contains
pg_basebackup: incompatible server version 11.6
Tried to install the correct version of
but the apt package is not found. Only
Question: How can we install the correct version of
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 errorpg_basebackup: incompatible server version 11.6
Tried to install the correct version of
pg_basebackup using the command: apt install postgresql-client-11but 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?Solution
Install it from PostgreSQL's own apt repository, adapted from these instructions.
pg_basebackup (PostgreSQL) 11.7 (Ubuntu 11.7-1.pgdg18.04+1)
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 -Vpg_basebackup (PostgreSQL) 11.7 (Ubuntu 11.7-1.pgdg18.04+1)
Code Snippets
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 -VContext
StackExchange Database Administrators Q#259784, answer score: 33
Revisions (0)
No revisions yet.