PostgreSQL源码包下载,去“https://www.postgresql.org/ftp/source”网站下载,根据需要的版本下载,比如这里下载:v17.6。
图6 下载PostgreSQL源码包
然后下载源码包“postgresql-17.6.tar.gz”。
图7 下载PostgreSQL源码包
# Rocky、Almalinux、CentOS、AnolisOS、OpenCloudOS、Kylin Server默认没有wget包,需要安装
yum install -y wget
# openEuler 22.03/24.03 LTS、AnolisOS 23、OpenCloudOS 9没有安装tar包,需要安装
yum install -y tar
cd /usr/local/src
# 下载解压缩
wget https://ftp.postgresql.org/pub/source/v17.6/postgresql-17.6.tar.gz
tar xf postgresql-17.6.tar.gz
编译安装参数解释:
./configure # 准备PostgreSQL的编译环境
--prefix # 指定 PostgreSQL 安装目录
--with-openssl # 启用 OpenSSL 支持
--with-libxml # 启用 XML 支持
--with-systemd # 启用 Systemd 支持
进入PostgreSQL包解压的目录:
cd postgresql-17.6
安装make包:
yum install -y make
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
yum install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for perl... no
configure: error: Perl not found # 提示,未找到Perl
安装perl包:
yum install -y perl
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
yum install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
yum install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
yum install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行make install:
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y make gcc libicu-devel bison flex perl readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
yum install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for perl... no
configure: error: Perl not found # 提示,未找到Perl
安装perl包:
yum install -y perl
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
yum install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
yum install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
yum install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行make install:
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y gcc libicu-devel bison flex perl readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
安装make包:
yum install -y make
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
yum install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
yum install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
yum install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
yum install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行configure:
# 再次执行make之前先清理之前的操作
make clean
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
make -j $(nproc) world
重新执行make install:
make install-world
。。。
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/sslinfo'
make -C xml2 install
make[2]: Entering directory '/usr/local/src/postgresql-17.6/contrib/xml2'
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y make gcc libicu-devel bison flex readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
yum install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
yum install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
yum install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
yum install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /usr/local/lib64/perl5/5.36 /usr/local/share/perl5/5.36 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at gen_node_support.pl line 24. # 提示,perl缺少FindBin.pm模块
BEGIN failed--compilation aborted at gen_node_support.pl line 24.
Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /usr/local/lib64/perl5/5.36 /usr/local/share/perl5/5.36 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ../../../src/backend/catalog/genbki.pl line 20.
BEGIN failed--compilation aborted at ../../../src/backend/catalog/genbki.pl line 20.
make[2]: *** [Makefile:141: bki-stamp] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/include/catalog'
make[1]: *** [Makefile:121: submake-catalog-headers] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:78: node-support-stamp] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/backend/nodes'
make[1]: *** [Makefile:125: submake-nodes-headers] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src/backend'
make: *** [src/Makefile.global:384: submake-generated-headers] Error 2
安装perl-FindBin和perl-core包:
yum install -y perl-FindBin perl-core
执行make:
make -j $(nproc) world
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行configure:
# 再次执行make之前先清理之前的操作
make clean
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
make -j $(nproc) world
重新执行make install:
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y gcc libicu-devel bison flex readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel perl-FindBin perl-core docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
安装make包:
yum install -y make
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
yum install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
yum install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
yum install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
yum install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行make install:
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y make gcc libicu-devel bison flex readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
安装make包:
yum install -y make
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
yum install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for perl... no
configure: error: Perl not found # 提示,未找到Perl
安装perl包:
yum install -y perl
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
yum install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
yum install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
yum install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行configure:
# 再次执行make之前先清理之前的操作
make clean
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
make -j $(nproc) world
重新执行make install:
make install-world
。。。
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/sslinfo'
make -C xml2 install
make[2]: Entering directory '/usr/local/src/postgresql-17.6/contrib/xml2'
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y make gcc libicu-devel bison flex perl readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
yum install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
yum install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
yum install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
yum install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
yum install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
yum install -y docbook-dtds docbook-style-xsl libxslt
重新执行make install:
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
yum install -y libicu-devel bison flex perl readline-devel systemd-devel docbook-dtds docbook-style-xsl libxslt
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
安装make包:
zypper install -y make
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
zypper install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装libicu-devel包:
zypper install -y libicu-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
zypper install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
zypper install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装readline-devel包:
zypper install -y readline-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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包:
zypper install -y zlib-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装openssl-devel包:
zypper install -y openssl-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-devel包:
zypper install -y libxml2-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装systemd-devel包:
zypper install -y systemd-devel
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: all] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: all] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:16: world-doc-recurse] Error 2
zypper install -y docbook-xsl-stylesheets
重新执行configure:
# 再次执行make之前先清理之前的操作
make clean
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
重新执行make:
make -j $(nproc) world
执行make install:
# 默认 make install 不包括安装文档
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
zypper install -y make gcc libicu-devel bison flex readline-devel zlib-devel openssl-devel libxml2-devel systemd-devel docbook-xsl-stylesheets
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
进入PostgreSQL包解压的目录:
cd postgresql-17.6
安装make包:
apt install -y make
执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: no acceptable C compiler found in $PATH # 提示,在$PATH中找不到可接受的C编译器,需要安装gcc
See `config.log' for more details
安装gcc包:
apt install -y gcc
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for pkg-config... no # 没有检测到pkg-config,要安装pkg-config,否则还会出现报错
checking whether to build with ICU support... yes
checking for icu-uc icu-i18n... no
configure: error: ICU library not found # 提示,未找到 ICU 库
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.
安装pkg-config和libicu-dev包:
apt install -y pkg-config libicu-dev
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for bison... no
configure: error: bison not found # 提示,未找到bison
安装bison包:
apt install -y bison
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for flex... no
configure: error: flex not found # 提示,未找到flex
安装flex包:
apt install -y flex
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for library containing readline... no
configure: error: readline library not found # 提示,未找到readline库
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
安装libreadline-dev包:
apt install -y libreadline-dev
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: zlib library not found # 提示,为找到zlib库
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.
安装zlib1g-dev包:
apt install -y zlib1g-dev
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL # 提示,需要库 'crypto' 来支持 OpenSSL
安装libssl-dev包:
apt install -y libssl-dev
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support # 提示,需要库 'xml2'(版本 >= 2.6.23)以支持 XML
安装libxml2-dev包:
apt install -y libxml2-dev
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
...
configure: error: header file <systemd/sd-daemon.h> is required for systemd support # 提示,需要头文件 <systemd/sd-daemon.h> 以支持 systemd
安装libsystemd-dev包:
apt install -y libsystemd-dev
继续执行configure:
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
执行make:
# 默认 make 不包括文档和其它模块,$(nproc)表示当产主机的CPU核心
make -j $(nproc) world
...
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/isolation'
make -C test/perl all
make[2]: Entering directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/src/test/perl'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/src'
执行make install:
# 默认 make install 不包括安装文档
make install-world
...
ERROR: `xmllint' is missing on your system.
***
make[3]: *** [Makefile:72: postgres-full.xml] Error 1
make[3]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src/sgml'
make[2]: *** [Makefile:8: install] Error 2
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/doc/src'
make[1]: *** [Makefile:16: install] Error 2
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/doc'
make: *** [GNUmakefile:32: install-world-doc-recurse] Error 2
apt install -y docbook-xml docbook-xsl libxml2-utils xsltproc fop
重新执行configure:
# 再次执行make之前先清理之前的操作
make clean
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
重新执行make:
make -j $(nproc) world
重新执行make install:
make install-world
。。。
/usr/bin/mkdir -p '/apps/pgsql/lib'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/mkdir -p '/apps/pgsql/share/extension'
/usr/bin/install -c -m 755 pgxml.so '/apps/pgsql/lib/pgxml.so'
/usr/bin/install -c -m 644 ./xml2.control '/apps/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./xml2--1.1.sql ./xml2--1.0--1.1.sql '/apps/pgsql/share/extension/'
make[2]: Leaving directory '/usr/local/src/postgresql-17.6/contrib/xml2'
make[1]: Leaving directory '/usr/local/src/postgresql-17.6/contrib'
总结编译过程:
# 安装依赖包
apt update
apt install -y make gcc pkg-config libicu-dev bison flex libreadline-dev zlib1g-dev libssl-dev libxml2-dev libsystemd-dev docbook-xml docbook-xsl libxml2-utils xsltproc fop
# 进入PostgreSQL包解压的目录:
cd postgresql-17.6
# 执行configure
./configure --prefix=/apps/pgsql --with-openssl --with-libxml --with-systemd
# 执行make
make -j $(nproc) world
# 执行make install
make install-world
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。