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

I want to setup dev environment for 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() 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?

1 Answer

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 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy