码迷,mamicode.com
首页 > 数据库 > 详细

Ubuntu12.04下postgresql-9.3.4编译源码出错,无readline library not found

时间:2015-06-30 00:06:23      阅读:2558      评论:0      收藏:0      [点我收藏+]

标签:

1.问题现象:

下载链接:http://www.postgresql.org/ftp/source/

解压后编译安装(需要root权限)

1 root@ubuntu:/opt/postgresql-9.3.4#  tar -zxvf postgresql-9.3.4.tar.gz
2 root@ubuntu:/opt/postgresql-9.3.4#  cd postgresql-9.3.4/
3 root@ubuntu:/opt/postgresql-9.3.4#  ./configure && make && make install

此时出现如下错误

技术分享

其中信息有说可以使用--without-readline,但是Pg官方不推荐如此使用。使用后具体结果,没试过不清楚。

另外的玩法是补全readline library:

root@ubuntu:/opt/postgresql-9.3.4# ldconfig -p | grep readline
libreadline.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.6

找到此系统中有libreadline.so.6这个库文件,而网上有很多说应该安装libreadline5-dev,但是安装此库时报错:

 

root@ubuntu:/opt/postgresql-9.3.4# apt-get install libreadline5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libreadline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libreadline-gplv2-dev:i386 lib64readline-gplv2-dev:i386 libreadline-gplv2-dev

E: Package ‘libreadline5-dev‘ has no installation candidate

猜想:这种安装应该对这种情况比较适合:libreadline.so.5 (libc6) => /lib/libreadline.so.5,含有这类的用上面的命令可以。

解决之法:

针对之前的显示就安装libreadline6-dev比较OK

root@ubuntu:/opt/postgresql-9.3.4# apt-get install  libreadline6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libtinfo-dev
The following NEW packages will be installed:
  libreadline6-dev libtinfo-dev
0 upgraded, 2 newly installed, 0 to remove and 79 not upgraded.
Need to get 367 kB of archives.
After this operation, 1,202 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://mirrors.163.com/ubuntu/ precise/main libtinfo-dev amd64 5.9-4 [103 kB]
Get:2 http://mirrors.163.com/ubuntu/ precise/main libreadline6-dev amd64 6.2-8 [264 kB]
Fetched 367 kB in 1s (230 kB/s)
Selecting previously unselected package libtinfo-dev.
(Reading database ... 82773 files and directories currently installed.)
Unpacking libtinfo-dev (from .../libtinfo-dev_5.9-4_amd64.deb) ...
Selecting previously unselected package libreadline6-dev.
Unpacking libreadline6-dev (from .../libreadline6-dev_6.2-8_amd64.deb) ...
Processing triggers for install-info ...
Setting up libtinfo-dev (5.9-4) ...
Setting up libreadline6-dev (6.2-8) ...

如此安装成功!!!

 

Ubuntu12.04下postgresql-9.3.4编译源码出错,无readline library not found

标签:

原文地址:http://www.cnblogs.com/longlang-justdoit/p/4609152.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!