Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install libpq-dev package error

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?

like image 911
KRH Avatar asked Jun 19 '13 05:06

KRH


People also ask

How do I install Libpq Dev on Windows?

Download one of the "core" files for the particular version you're looking for. You'll get a tarball that if you expand you'll find a "libpq" folder. Where that should go on your system depends on what kind of development toolchain you're using.

What is Libpq Dev used for?

libpq is a set of library functions that allow client programs to pass queries to the PostgreSQL backend server and to receive the results of these queries.

What is libpq5?

libpq is a C library that enables user programs to communicate with the PostgreSQL database server. The server can be on another machine and accessed through TCP/IP. This version of libpq is compatible with servers from PostgreSQL 8.2 or later. This package contains the run-time library, needed by packages using libpq.


3 Answers

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

like image 191
ismailsunni Avatar answered Sep 19 '22 13:09

ismailsunni


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
like image 29
mackwerk Avatar answered Sep 18 '22 13:09

mackwerk


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

like image 30
Max Sherbakov Avatar answered Sep 17 '22 13:09

Max Sherbakov