---
title: 编译PostgreSQL时，执行configure过程中提示readline library not found的解决方法
description: "在编译PostgreSQL时，执行configure过程中提示“configure: error: readline library not found”。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdbs/troubleshooting/trouble/boostkit_database_troublecase_017.html
sourcePath: /source/zh/kunpengdbs/troubleshooting/trouble/boostkit_database_troublecase_017.html
indexId: e37ae9385a49c036d91f5f179f96a75b7c70485304970262faead88dc01e153384
---
# 编译PostgreSQL时，执行configure过程中提示readline library not found的解决方法

#### 问题现象描述

在编译PostgreSQL时，执行configure过程中提示“configure: error: readline library not found”。


#### 关键过程、根本原因分析

系统缺少readline动态库导致的问题。


#### 结论、解决方案及效果

- 方案一：（推荐）安装readline相关依赖。

  1. 检查系统是否已安装readline。
    1 rpm -qa | grep readline

  2. 搜索readline相关包。
    1 yum search readline

  3. 安装readline-devel依赖包。
    1 yum -y install -y readline-devel

  4. 检查readline-devel是否安装成功。
    1 rpm -qa | grep readline

  5. 返回PostgreSQL编译路径，再次执行configure。
    1 ./configure

- 方案二：执行configure时增加--without-readline参数。
  “readline”用于在命令行中读取用户输入。使用该方法进行命令行编辑时，它将读取用户在命令行中输入的一行文本并将其存储在变量中。用户可以对该变量进行操作，例如打印、修改等。一旦用户完成了对该变量的操作，将无法再在命令行中输入新的信息。不建议使用此方法。

  1 ./configure --without-readline
