Install libpq-dev package error
Asked Answered
A

4

20

I tried to install pg gem and I have had this warning:

You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.

So I tried install libpq-dev package and I have had this warning:

libpq-dev : Depends: libpq5 (= 8.4.17-0squeeze1) but 9.1.9-1~bpo60+1 is to be installed

How to fix this?

Academicism answered 19/6, 2013 at 5:53 Comment(1)
This same error appears when installing the node-postgres package.Azarcon
U
21

This should let you install the package you need :) Just tried it myself, I am not sure you will need all the packages on the second line, try it and see :)

apt-get update
apt-get install libxslt-dev libxml2-dev libpam-dev libedit-dev
aptitude install -t squeeze-backports postgresql-server-dev-9.1
Underhung answered 19/6, 2013 at 12:42 Comment(2)
On 15.04: sudo aptitude install postgresql-server-dev-9.4 worked. No other dependencies needed to take care of the error. This is using VirtualBox with test-kitchen and vivid server.Melonymelos
now i am getting aptitude: command not found.Eada
N
27

I have a similar problem, I solved it by installing a specific version of libpg5

sudo apt install libpq5=10.12-0ubuntu0.18.04.1

My machine is Ubuntu 18.04

Noria answered 24/8, 2020 at 9:55 Comment(5)
I got E: Version '10.12-0ubuntu0.18.04.1' for 'libpq5' was not foundLancers
This worked for me with the version listed in my error messageMiddleoftheroader
I think you mean libpq5=10.21-0ubuntu0.18.04.1 (21, not 12), per packages.ubuntu.com/bionic/libpq5Parashah
Note, this resulted in "The following packages will be REMOVED: pgadmin4 pgadmin4-desktop pgadmin4-server pgadmin4-web" for me.Parashah
I couldn't fix the problem with apt install So, I used sudo aptitude install and downgraded version to match compatibility. It works. FYIs,Ubana
U
21

This should let you install the package you need :) Just tried it myself, I am not sure you will need all the packages on the second line, try it and see :)

apt-get update
apt-get install libxslt-dev libxml2-dev libpam-dev libedit-dev
aptitude install -t squeeze-backports postgresql-server-dev-9.1
Underhung answered 19/6, 2013 at 12:42 Comment(2)
On 15.04: sudo aptitude install postgresql-server-dev-9.4 worked. No other dependencies needed to take care of the error. This is using VirtualBox with test-kitchen and vivid server.Melonymelos
now i am getting aptitude: command not found.Eada
B
6

You must setup postgresql-server-dev-X.Y, where X.Y. your's servers version, and it will install libpq-dev and other servers variables at modules for server side developing. In my case it was

apt-get install postgresql-server-dev-9.5

Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libmysqlclient18 mysql-common Use 'apt-get autoremove' to remove them. The following extra packages will be installed:
libpq-dev Suggested packages: postgresql-doc-10 The following NEW packages will be installed: libpq-dev postgresql-server-dev-9.5

Bladder answered 5/1, 2018 at 10:37 Comment(1)
The strange thing: on my Rasbian libpg-dev can not be installed on its own. But installing postgresql-server-dev-11 actually says, that it will install libpg-dev. And after that the developing library is actually installed, but dpkg -l libpg-dev does not show any result.Hurlbut
E
2

I executed

apt-get -y libpq-dev

and it worked

Erinn answered 9/3, 2023 at 16:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.