I am currently trying to install libpq-dev to install psycopg2. The problem is, when I try to install it, an error occurs saying I don't have the latest libpq5 version. However when I try to download the newer version of libpq5 the system says that I already have the latest version. An example of the error.
lhmendes@lhmendes-GA-78LMT-S2P:~$ sudo apt-get install libpq-dev
Reading package lists... Done
Building dependency tree
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:
libpq-dev : Depends: libpq5 (= 12.4-0ubuntu0.20.04.1) but 12.4-1.pgdg20.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.
lhmendes@lhmendes-GA-78LMT-S2P:~$ sudo apt-get install libpq5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpq5 is already the newest version (12.4-1.pgdg20.04+1).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
libpq
(12.4-1
) butlibpq-dev
needs older version (12.4-0
) and this makes problem. You may try to install olderlibpq
-apt-get install libpq==12.4-0ubuntu0.20.04.1
but if other program uses the latest version then older version can make problem. Strange ispgdg20
in12.4-1.pgdg20.04+1
because it is not module from standard ubuntu repo but from some other repo - and maybe this repo has also latest versionlibpq-dev
. You would search12.4-1.pgdg20.04+1
in Google and maybe you find alsolibpg-dev
with12.4-1.pgdg20.04+1
– Heartwhole.deb
file and install it. OR you can add postgresql repo and install withapt-get
– Heartwhole.deb
but the same error occurred. Saying that i do not have some of the dependencies needed. EDIT: the link was sending to the page to downloadlibpq-dev 12.4-1.pgdg18.04+1
. Just downloaded the 20.04 one and worked! Thanks a lot! – Pleasure