Subject: Problems installing postgis and postgresql-16-postgis-3

From: Pavel Konoplev <[email-masked]>
Date: Mon, 23 Sep 2024 10:40:13 +0300

I have certain problems installing postgis and postgresql-16-postgis-3:

$ sudo apt-get install postgresql-16-postgis-3
[sudo] password for user:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-16-postgis-3 : Depends: libgdal26 (>= 2.4.0) but it is not
installable
                           Depends: libjson-c4 (>= 0.13.1) but it is not
installable
                           Depends: libproj15 (>= 6.1.0) but it is not
installable
E: Unable to correct problems, you have held broken packages.

When I search this package on Ubuntu packages:
so I don't have the option to install a lower version of gdal, but in this
case I need to have the 16th version of postgres.. What could I do?

---

From: Christoph Berg <[email-masked]>
Date: Mon, 23 Sep 2024 12:51:11 +0200

Re: Pavel Konoplev
>  postgresql-16-postgis-3 : Depends: libgdal26 (>= 2.4.0) but it is not

Hi,

libgdal26 is for focal.

Which Ubuntu release are you on? Are you using the right *-pgdg suite
in /etc/apt/sources.list.d/pgdg.sources?

Christoph

---

From: Pavel Konoplev <[email-masked]>
Date: Mon, 23 Sep 2024 17:52:22 +0300

I use:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy

ahh, i haven't this file (etc/apt/sources.list.d/pgdg.sources)... what
should be in this file?

---

From: Christoph Berg <[email-masked]>
Date: Mon, 23 Sep 2024 17:57:51 +0200

Re: Pavel Konoplev
> ahh, i haven't this file (etc/apt/sources.list.d/pgdg.sources)... what

You should have some file in /etc/apt/sources.list* which mentions
focal-pgdg. Update that to jammy-pgdg.

Christoph

---

From: Pavel Konoplev <[email-masked]>
Date: Thu, 26 Sep 2024 12:38:33 +0300

Thank you for helping me with the solution, but apparently I decided to
update Ubuntu to version 24 and it helped me install postgis easily