On bionic with (necessary) libpq5 (v13.0-1.pgdg18.04+1): Cannot install libgdal-dev (v2.2.3+dfsg-2). Recommendations?

Asked by Neil Simon on 2020-11-18

Hello,

Any help or advice would be greatly appreciated.

The installed libpq5 (v13.0-1.pdgd18.04+1) must remain -- it is required for pgadmin4.

Any recommendations on how to install libgdal-dev in this environment?

The below detail shows the failed installation attempt:

$ sudo apt policy libgdal-dev
libgdal-dev:
  Installed: (none)
  Candidate: 2.2.3+dfsg-2

$ sudo apt install libgdal-dev
...
libgdal-dev : Depends: libpq-dev but it is not going to be installed

$ sudo apt install libpq-dev
...
libpq-dev : Depends: libpq5 (= 10.14-0ubuntu0.18.04.1) but 13.0-1.pgdg18.04+1 is to be installed

$ sudo apt install libpq5
libpq5 is already the newest version (13.0-1.pgdg18.04+1).

Thanks in advance, Neil

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gdal Edit question
Assignee:
No assignee Edit question
Solved by:
Neil Simon
Solved:
2020-11-19
Last query:
2020-11-19
Last reply:
2020-11-19

This question was reopened

Manfred Hampl (m-hampl) said : #1

For diagnostic purposes please provide the output of the commands

uname -a
lsb_release -crid
apt-cache policy libpq5 pgadmin4 libpq-dev

How did you install libpq5 (v13.0-1.pdgd18.04+1)?
You probably have to install libpq-dev from the same source.

Neil Simon (nsimon99) said : #2

Thanks for your help Manfred.

Here is the info you requested.

$ uname -a
Linux rstudio 4.15.0-123-generic #126-Ubuntu SMP Wed Oct 21 09:40:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

$ apt-cache policy libpq5 pgadmin4 libpq-dev
libpq5:
  Installed: 13.0-1.pgdg18.04+1
  Candidate: 13.0-1.pgdg18.04+1
  Version table:
 *** 13.0-1.pgdg18.04+1 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main amd64 Packages
        100 /var/lib/dpkg/status
     12.4-1.pgdg18.04+1 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main amd64 Packages
     12.3-1.pgdg18.04+1 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main amd64 Packages
     10.14-0ubuntu0.18.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     10.3-1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
pgadmin4:
  Installed: 4.28
  Candidate: 4.28
  Version table:
 *** 4.28 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
        100 /var/lib/dpkg/status
     4.27 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
     4.26 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
     4.25 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
     4.24 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
     4.23 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
     4.22 500
        500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4/main all Packages
libpq-dev:
  Installed: (none)
  Candidate: 10.14-0ubuntu0.18.04.1
  Version table:
     10.14-0ubuntu0.18.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     10.3-1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

Someone else on our team installed pgadmin4, by first adding a new ppa:
$ cat /etc/apt/sources.list.d/pgadmin4.list
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4 main

When installing pgadmin4 from this ppa, libpq5 (v13.0-1.pdgd18.04+1) was installed as a dependency.

Thanks, Neil

Manfred Hampl (m-hampl) said : #3

I am sorry, but I cannot provide a solution.

By installing pgadmin4 from ftp.postgresql.org you have ended up with a version of libpq5 that is incompatible to any libpq5-dev package from the Ubuntu repositories.

I see two possibilities:
- revert libpq5 to the version in the Ubuntu repositories (this will probably need that pgadmin4 is uninstalled)
or
- check with postgresql.org how to install libpq5-dev fitting to their libpq5 package.

Maybe https://wiki.postgresql.org/wiki/Apt helps.
There definitely is a libpq5-dev package in a slightly different version - 13.1-1.pgdg18.04+1 in https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-13/
My assumption is that upgrading libpq5 to the same version should allow installing libpq-dev

Disclaimer: These are foreign packages, Ubuntu cannot give any warranty whatsoever.

Neil Simon (nsimon99) said : #4

Thank you for your help Manfred.

I'll look into the solutions you proposed.

Neil