Bootstrap

ubuntu源码安装postgresql17找不到ICU模块的解决办法

ICU(International Components for Unicode)库的作用是为软件应用提供Unicode和全球化支持。它是一个成熟的、广泛使用的开源项目,由IBM赞助、支持和使用,并基于IBM公共许可证。ICU库支持多种编程语言,如C、C++、Java和.NET,使得开发者可以在这些平台上实现软件的国际化。

1. 在ubuntu 24 使用源码安装postgresql数据库时,提示找不到icu模块

configure: error: ICU library not found
If you have ICU already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-icu to disable ICU support.

2. 首先尝试安装该模块, 再进行编译

$ apt   install libicu-dev
$ ./configure

3. 如果依然提示找不到,可能需要安装pkg-config 模块

apt install  pkg-config

4. 再次尝试编译,编译通过

checking how to run the C preprocessor... gcc -E
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether to build with ICU support... yes
checking for icu-uc icu-i18n... yes

;