標籤:
1.問題現象:
下載連結:http://www.postgresql.org/ftp/source/
解壓後編譯安裝(需要root許可權)
1 [email protected]:/opt/postgresql-9.3.4# tar -zxvf postgresql-9.3.4.tar.gz2 [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 readline
libreadline.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-devReading package lists... DoneBuilding dependency treeReading state information... DoneThe following extra packages will be installed: libtinfo-devThe following NEW packages will be installed: libreadline6-dev libtinfo-dev0 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