1

I am new to Ubuntu and Linux in general. Im using ubuntu 22.04 and i am trying to install postgresql.

I ve tried to troubleshoot the following error but i ve lost hours trying to do so, still not even close to resolve it:

The following packages have unmet dependencies: postgresql-14 : Depends: postgresql-common (>= 229~) but it is not going to be installed Depends: libllvm14 but it is not installable Recommends: sysstat but it is not installable E: Unable to correct problems, you have held broken packages.

Could someone please help me?

1 Answer 1

1

Installing PostgreSQL on Ubuntu 22.04 is generally done like this:

sudo apt install postgresql postgresql-contrib

The default packages will install PostgreSQL 14.4.

If you have added third-party PPAs to install PostgreSQL with, this may be causing your problem. Remove them from your sources list, update apt, and try again.

Note: I install PostgreSQL on a fresh Ubuntu installation at least once a week as part of my regular database restoration testing process. The above command has always worked so long as the machine was connected to the interwebs.

4
  • well i removed everything from source list and running the above command gives me: E: Unable to locate package postgresql E: Unable to locate package postgresql-contrib Aug 12, 2022 at 13:47
  • 2
    @Stefan Milič Did you ever run sudo apt update as indicated, before trying again?
    – ubfan1
    Aug 12, 2022 at 16:05
  • yes, I ve did run it. Aug 12, 2022 at 21:28
  • When you say you "removed everything from source list", do you mean that your /etc/apt/sources.list file is now empty? 🤔
    – matigo
    Aug 12, 2022 at 22:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .