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

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) ...

如此安装成功!!!

 

转载于:https://www.cnblogs.com/longlang-justdoit/p/4609152.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值