PostgreSQL源码包下载,去“https://www.postgresql.org/ftp/source”网站下载,根据需要的版本下载,比如这里下载:v17.6。

图6 下载PostgreSQL源码包
然后下载源码包“postgresql-17.6.tar.gz”。

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