Installation PostgreSQL appears Configure:error:readline library not found workaround

Source: Internet
Author: User
Tags psql readline line editor



To install ReadLine, Readline-dev the development package, or turn off the ReadLine feature using the--without-readline option.



#yum install readline;



#yum install Readline-dev;




ReadLine is the command line editor, close, you can not edit the command line directly with Psql, if the wrong instruction, can not roll back the command history, can only be re-entered manually.









During the installation of PostgreSQL, a problem was encountered during the execution of the Configure



In the process reported the following error, Configure:error:readline library not found, but I installed in the system
ReadLine the bag,



1. Environmental Information


2. According to the instructions, test the next Configre command, and really reported this error
[Email protected] postgresql-9.0.0]#./configure
Checking build system Type ... I686-pc-linux-gnu
Checking host system Type ... I686-pc-linux-gnu
Checking which template to use ... Linux
Checking whether to build with 64-bit integer date/time support ... yes
Checking whether NLS is wanted ... no
Checking for default port number ... 5432
Checking for block size ... 8kB
Checking for segment Size ... 1GB
Checking for WAL block size ... 8kB
Checking for WAL segment size ... 16MB
Checking for gcc ... gcc
Checking for C compiler default output file name ... a.out
Checking whether the C compiler works ... yes
Checking whether we is cross compiling ... no
Checking for suffix of executables ...
Checking for suffix of object files ... o
Checking whether we are using the GNU C compiler ... yes
Checking whether GCC accepts-g ... yes
Checking for GCC option to accept ISO C89 ... none needed
Checking if gcc supports-wdeclaration-after-statement ... yes
Checking if gcc supports-wendif-labels ... yes
Checking if gcc supports-fno-strict-aliasing ... yes
Checking if gcc supports-fwrapv ... yes
Checking whether the C compiler still works ... yes
Checking how to run the C preprocessor ... gcc-e
Checking allow Thread-safe client libraries ... yes
Checking whether to build with Tcl ... No
Checking whether to build Perl modules ... no
Checking whether to build Python modules ... no
Checking whether to build with GSSAPI support ... no
Checking whether to build with Kerberos 5 support ... no
Checking whether to build with PAM support ... no
Checking whether to build with LDAP support ... no
Checking whether to build with Bonjour support ... no
Checking whether to build with OpenSSL support ... no
Checking for grep that handles long lines and-e .../bin/grep
Checking for egrep .../bin/grep-e
Checking for LD used by GCC .../usr/bin/ld
Checking if the linker (/USR/BIN/LD) is GNU ld ... Yes
Checking for ranlib ... ranlib
Checking for strip ... strip
Checking whether it's possible to strip libraries ... yes
Checking for ar ... Ar
Checking for tar .../bin/tar
Checking whether Ln-s works ... yes
Checking for gawk ... gawk
Checking for a thread-safe mkdir-p .../bin/mkdir-p
Checking for bison ... no
Configure:warning:
Without Bison you are not being able to build PostgreSQL from CVS nor
Change any of the parser definition files. You can obtain Bison from
A GNU mirror site. (If you are using the official distribution of
PostgreSQL then don't need to worry on this, because the Bison
Output is pre-generated.)
Checking for flex ... no
Configure:warning:
Without Flex you are not being able to build PostgreSQL from CVS nor
Change any of the scanner definition files. You can obtain Flex from
A GNU mirror site. (If you are using the official distribution of
PostgreSQL then don't need to worry on this because the Flex
Output is pre-generated.)
Checking for Perl .../usr/bin/perl
Configure:using Perl 5.8.8
Checking for main in-lm ... yes
Checking for library containing setproctitle ... no
Checking for library containing dlopen ...-ldl
Checking for library containing socket ... none required
Checking for library containing shl_load ... no
Checking for library containing getopt_long ... none required
Checking for library containing crypt ...-lcrypt
Checking for library containing fdatasync ... none required
Checking for library containing gethostbyname_r ... none required
Checking for library containing shmget ... none required
Checking for-lreadline ... no
Checking for-ledit ... no


Configure:error:readline Library not found
If you had readline already installed, see Config.log for details on the
Failure. It is possible the compiler isnt looking in the proper directory.
Use--without-readline to disable ReadLine support.


According to the prompt, the ReadLine package should not be installed.



3. Check if the system installs the ReadLine package
[Email protected] postgresql-9.0.0]# Rpm-qa | grep ReadLine
Readline-5.1-3.el5



Note that the system already has the ReadLine package installed.



4.  Search for related readline packages via yum
[[email protected] postgresql-9.0.0]# yum Search ReadLine
Lftp.i386:a sophisticated file transfer program
lftp.i386:a sophisticated file transfer program
Php-readline . I386:standard PHP Module provides readline library support
lftp.i386:a sophisticated file transfer program
Read LINE.I386:A Library for editing typed command lines.
compat-readline43.i386:the readline 4.3 library for compatibility with older software.
Readline-devel.i386:files needed to develop programs which use the ReadLine library.
READLINE.I386:A Library for editing typed command lines.



According to the tip, there is a package that causes attention to "readline-devel", speculation may be related to this package.

5. Installing the Readline-devel package
[Email protected] postgresql-9.0.0]# yum-y install-y readline-devel
Setting up Install Process
Parsing Package Install arguments
Resolving Dependencies
--Running Transaction check
---> Package readline-devel.i386 0:5.1-3.el5 Set updated
--processing dependency:libtermcap-devel for Package:readline-devel
--Running Transaction check
---> Package libtermcap-devel.i386 0:2.0.8-46.1 Set updated
--Finished Dependency Resolution



Dependencies resolved


=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
Readline-devel i386 5.1-3.el5 base 146 K
Installing for dependencies:
Libtermcap-devel i386 2.0.8-46.1 base + K


Transaction Summary
=============================================================================
Install 2 package (s)
Update 0 Package (s)
Remove 0 Package (s)



Total Download size:201 k
Downloading Packages:
(a): Libtermcap-devel-2 100% |=========================| KB 00:00
(2/2): readline-devel-5.1 100% |=========================| 146 KB 00:00
Running Rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing:libtermcap-devel ######################### [1/2]
Installing:readline-devel ######################### [2/2]



Installed:readline-devel.i386 0:5.1-3.el5
Dependency installed:libtermcap-devel.i386 0:2.0.8-46.1
complete!



6. Execute configure successfully again.



7. There is also a workaround: The Configure plus the parameter--without-readline, but this can not be entered in the command line, so it is not recommended ...



8. Configure after the success, then it's make.



 9. After make is installed, the installation is successful and the interface appears as shown






10. Modify the permissions of the PostgreSQL installation directory, the default installation directory under/usr/local/pgsql



The Modify Permissions command is Chmod-r 777/usr/local/pgsql



After running, all files under the Pgsql directory will have XWR (X: Executable, W: writable, R: readable) permissions. The-r parameter description in the command is recursive to the folder Pgsql directory and all files under the directory are modified to the appropriate permissions, 777 is the representative plus for this user, the user group of other users and not the group of users to increase XWR permissions.






11. To this, PostgreSQL installation is complete, then you can try to use this open source database ...



1): First of all, initialize the database. Go to the folder that just installed PG/home/pg/postgr (this is the directory where I installed PG, the default installation directory is under/usr/local/pgsql), enter./bin/initdb–d. /data. The command format here also needs to be understood, especially-the meaning of parameters such as D. This will result in a data folder below the POSTGR.



2): Start the database server./bin/postmaster–d./data&. The meaning of & need to understand, poor this symbol will lead to a certain problem, seemingly start the database server can also use another command:/bin/postgres-d./data or./bin/pg_ctl-d./data-l logfile Start The difference between these commands can be found in the manual or consult the TA.












3): Under another command line, create a local database./bin/createdb TestDB, where TestDB is the database name. A folder is generated under the data directory












4): Link database server/bin/psql testdb. At this point, enter help to get assistance. See















5): Access the database. Here is the input SQL command, the future debugging of the entrance is here. When finished, press \q to exit.






6): Finally, shut down the database server./bin/pg_ctl stop–d./data.



12.That ' s all!


In addition, the following questions may be reported:



./configure--prefix=/usr/local/pgsql



.....



Configure:error:zlib Library not found
If you had zlib already installed, see Config.log for details on the
Failure. It is possible the compiler "t looking in the proper directory.
Use--without-zlib to disable zlib support.






Workaround


Yum install zlib-devel;






Reference:



Http://www.cnblogs.com/shuaixf/archive/2011/11/29/2268292.html



Http://www.cnblogs.com/shuaixf/archive/2011/11/29/2268298.html





Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.