Ubuntu – Unmet dependencies for PostgreSQL 10 under Ubuntu 16.04.5 LTS (xenial)

aptinstallationpostgresqlubuntu 16.04

Following official instructions in https://www.postgresql.org/download/linux/ubuntu/, I got following error:

The following packages have unmet dependencies:
 postgresql-10 : Depends: postgresql-client-10
                 Depends: libgssapi-krb5-2 (>= 1.14+dfsg) but 1.13.2+dfsg-5ubuntu2 is to be installed
                 Depends: libicu60 (>= 60.1-1~) but it is not installable
                 Depends: libpq5 (>= 9.3~) but it is not going to be installed
                 Depends: libssl1.1 (>= 1.1.0) but it is not installable
                 Recommends: sysstat but it is not going to be installed

Linux distribution is: Ubuntu 16.04.5 LTS

I've tried many recommendations, that are about purging, upgrading apt, but nothing helps.

Is it ever possible to install PostgreSQL 10 under Ubuntu 16.04.5 LTS?

Also, I'm unable now to install PostgreSQL 9.6 version, that AFAIK, comes standard…

How to revert to standard version?

Best Answer

On the PostgreSQL: Linux downloads (Ubuntu) page, you chose "Bionic (18.04)"1, which does not match your actual Ubuntu version, "Xenial (16.04)".

Assuming this is the only error you made while following the instructions on that page, you can fix this by opening the file /etc/apt/sources.list.d/pgdg.list as root and changing every mention of bionic to xenial.

Here is a command you can run to do this immediately:

sudo sed -i 's/bionic/xenial/g' /etc/apt/sources.list.d/pgdg.list

After you have done that, you should be able to install PostgreSQL 10 like so:

sudo apt update
sudo apt install postgresql-10

1 I was able to determine that you selected the bionic repo by checking the contents of http://apt.postgresql.org/pub/repos/apt/dists/bionic-pgdg/main/binary-amd64/Packages and seeing that the dependencies of Package: postgresql-10 match your list of unresolvable dependencies.

Related Question