1.问题现象:
下载链接:http://www.postgresql.org/ftp/source/
解压后编译安装(需要root权限)
1 [email protected]:/opt/postgresql-9.3.4# tar -zxvf postgresql-9.3.4.tar.gz 2 [email protected]:/opt/postgresql-9.3.4# cd postgresql-9.3.4/ 3 [email protected]:/opt/postgresql-9.3.4# ./configure && make && make install
此时出现如下错误
其中信息有说可以使用--without-readline,但是Pg官方不推荐如此使用。使用后具体结果,没试过不清楚。
另外的玩法是补全readline library:
[email protected]:/opt/postgresql-9.3.4# ldconfig -p | grep readlinelibreadline.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.6
找到此系统中有libreadline.so.6这个库文件,而网上有很多说应该安装libreadline5-dev,但是安装此库时报错:
[email protected]:/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
[email protected]:/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) ...
如此安装成功!!!