如何在Centos 5.5上安装libpq-dev

为了开发一个基于postgresql的Web应用程序,我需要在我的Centos上安装libpq。

我可以在Ubuntu上安装“apt-get install libpq-dev”,但是我不能通过“yum install libpq”将它安装在centos上。

谁能告诉我如何安装,谢谢!

该软件包在Red Hat和派生的发行版上被称为postgresql-libs

我只需要在我的CentOS 6服务器上安装它,因为psycopg2需要pg_config。 Boo yah:

 yum install postgresql-devel 

更新

如果您仍然遇到pg_config的问题,则可能需要将其添加到PATH中,例如:

 export PATH=$PATH:/usr/pgsql-xx/bin 

其中xx是您的版本,例如/usr/pgsql-9.2./bin。

这是libpqxx

 Name : libpqxx-devel Arch : x86_64 Version : 2.6.9 Release : 3.el5.rf Size : 1.4 M Repo : rpmforge Summary : Header files, libraries and development documentation for libpqxx. URL : http://pqxx.org/ License : BSD Description: This package contains the header files, static libraries and development : documentation for libpqxx. If you like to develop programs using libpqxx, : you will need to install libpqxx-devel. 

你可以从rpmforge或epel repo安装它:

 # yum install libpqxx-devel