Bootstrap

安装postgreSQL12.0出现错误提示 configure: error: zlib library not found。

安装postgreSQL12.0出现错误提示 configure: error: zlib library not found。

报错信息如下:

[root@localhost postgresql-12.0]# ./configure --prefix=/usr/local/pgsql
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
....................................................
checking for library containing readline... -lreadline
checking for inflate in -lz... no
configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.

解决方案:安装zlib-devel

[root@localhost postgresql-12.0]# yum install zlib-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package zlib-devel.x86_64 0:1.2.7-19.el7_9 will be installed
--> Processing Dependency: zlib = 1.2.7-19.el7_9 for package: zlib-devel-1.2.7-19.el7_9.x86_64
--> Running transaction check
---> Package zlib.x86_64 0:1.2.7-18.el7 will be updated
---> Package zlib.x86_64 0:1.2.7-19.el7_9 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================
 Package                                      Arch                                     Version                                             Repository                                 Size
===========================================================================================================================================================================================
Installing:
 zlib-devel                                   x86_64                                   1.2.7-19.el7_9                                      updates                                    50 k
Updating for dependencies:
 zlib                                         x86_64                                   1.2.7-19.el7_9                                      updates                                    90 k

Transaction Summary
===========================================================================================================================================================================================
Install  1 Package
Upgrade             ( 1 Dependent package)

Total download size: 140 k
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): zlib-1.2.7-19.el7_9.x86_64.rpm                                                                                                                               |  90 kB  00:00:00     
(2/2): zlib-devel-1.2.7-19.el7_9.x86_64.rpm                                                                                                                         |  50 kB  00:00:01     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                      104 kB/s | 140 kB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : zlib-1.2.7-19.el7_9.x86_64                                                                                                                                              1/3 
  Installing : zlib-devel-1.2.7-19.el7_9.x86_64                                                                                                                                        2/3 
  Cleanup    : zlib-1.2.7-18.el7.x86_64                                                                                                                                                3/3 
  Verifying  : zlib-devel-1.2.7-19.el7_9.x86_64                                                                                                                                        1/3 
  Verifying  : zlib-1.2.7-19.el7_9.x86_64                                                                                                                                              2/3 
  Verifying  : zlib-1.2.7-18.el7.x86_64                                                                                                                                                3/3 

Installed:
  zlib-devel.x86_64 0:1.2.7-19.el7_9                                                                                                                                                       

Dependency Updated:
  zlib.x86_64 0:1.2.7-19.el7_9                                                                                                                                                             

Complete!
[root@localhost postgresql-12.0]# ls -l /usr/include/ | grep zlib 
-rw-r--r--   1 root root  86717 Feb  3  2021 zlib.h

参考链接:https://blog.csdn.net/liyazhen2011/article/details/88972262

;