Score:0

How to install libpq-dev (14.0-1) on ubuntu 21.10?

cn flag

I already have the postgresql of latest version(14.0-1.pgdg21.04+1).

I want to setup dev environment for psycopg2(https://github.com/psycopg/psycopg2/) library locally and it requires libpq-dev for that.

Running sudo apt-get install libpq-dev gives following error

The following packages have unmet dependencies: libpq-dev : Depends: libpq5 (= 13.4-1) but 14.0-1.pgdg21.04+1 is to be installed E: Unable to correct problems, you have held broken packages.

It's because ubuntu repository(https://packages.ubuntu.com/impish/libpq-dev) doesn't have the latest version yet.

But I've found that debian sid repository have the latest version libpq-dev (14.0-1)

I can download the .deb file and dpkg install it but the downside is I can't upgrade it. Also, I don't want to add debian in my sources list, because it might mess a lot of other things.

So, what's the easiest way to download this package?

Score:0
ph flag

For me running the following code solved the problem

sudo apt-get install libpq-dev
Score:0
it flag

Just install the required version of libpq5 and reinstall libpq-dev:

sudo apt-get install libpq5=13.4-1
sudo apt-get install libpq-dev

I suppose for psycopg2 you also need:

sudo apt-get install python3-dev
Krishna avatar
cn flag
Thanks for you answer. Welcome to Ask Ubuntu. I had made it clear in the title and description as well that I need to install the latest version(14.0-1). Downgrading is obviously a solution but in my case not helpful.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.