从零开始学PostgreSQL (四) & Linux 源码编译安装 PostgreSQL

一、源码安装

1.1 下载并解压安装包

第一步:访问PostgreSQL官网

​ 官网地址:https://www.postgresql.org/

第二步:点击Download进入下载页面。 image-20240117125455339 第三步:点击Source进入源码包下载页面。 image-20240117125653942 第四步:根据自己的版本需求选择相应版本的源码包

这里我们选择的是最新的16.1版本。

image-20240117125822333

选择tar.gz压缩包

image-20240117130113714第五步:将下载后的压缩包上传到服务器上,并对压缩包进行解压。

注意:

​ 1、如果实在互联网环境下,可以使用wget命令来进行下载。

shell [root@VM-16-10-centos opt]# wget https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz --no-check-certificate

​ 2、这里我们是存在于/opt目录下。

```shell [root@VM-16-10-centos opt]# pwd /opt [root@VM-16-10-centos opt]# ll total 31684 drwxr-xr-x 4 root root 4096 Jan 14 18:27 mellanox -rw-r--r-- 1 root root 32433767 Nov 7 06:19 postgresql-16.1.tar.gz drwxr-xr-x. 2 root root 4096 Oct 31 2018 rh

解压PostgreSQL源码包

[root@VM-16-10-centos opt]# tar -zxvf postgresql-16.1.tar.gz [root@VM-16-10-centos opt]# ll total 31688 drwxr-xr-x 4 root root 4096 Jan 14 18:27 mellanox drwxrwxrwx 6 1107 1107 4096 Nov 7 06:18 postgresql-16.1 # 这就是我们需要的解压之后的源码包 -rw-r--r-- 1 root root 32433767 Nov 7 06:19 postgresql-16.1.tar.gz drwxr-xr-x. 2 root root 4096 Oct 31 2018 rh ```

进入到解压后的源码包下

shell [root@VM-16-10-centos opt]# cd postgresql-16.1/ [root@VM-16-10-centos postgresql-16.1]# ll total 876 -rw-r--r-- 1 1107 1107 365 Nov 7 06:04 aclocal.m4 drwxrwxrwx 2 1107 1107 4096 Nov 7 06:17 config -rwxr-xr-x 1 1107 1107 584560 Nov 7 06:04 configure -rw-r--r-- 1 1107 1107 87292 Nov 7 06:04 configure.ac drwxrwxrwx 61 1107 1107 4096 Nov 7 06:17 contrib -rw-r--r-- 1 1107 1107 1192 Nov 7 06:04 COPYRIGHT drwxrwxrwx 3 1107 1107 4096 Nov 7 06:17 doc -rw-r--r-- 1 1107 1107 4288 Nov 7 06:04 GNUmakefile.in -rw-r--r-- 1 1107 1107 277 Nov 7 06:04 HISTORY -rw-r--r-- 1 1107 1107 64601 Nov 7 06:18 INSTALL -rw-r--r-- 1 1107 1107 1875 Nov 7 06:04 Makefile -rw-r--r-- 1 1107 1107 102017 Nov 7 06:17 meson.build -rw-r--r-- 1 1107 1107 6266 Nov 7 06:04 meson_options.txt -rw-r--r-- 1 1107 1107 1213 Nov 7 06:04 README drwxrwxrwx 16 1107 1107 4096 Nov 7 06:18 src

解释一下源码包中内容各自的作用:

aclocal.m4:该文件包含在构建过程中由autoconf工具使用的宏。这些宏有助于配置构建环境。

config:这个目录包含在构建过程中使用的配置文件和脚本。

configure:这是由autoconf工具生成的可执行脚本。用于配置源代码以适应目标系统。

configur

  • 18
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

「已注销」

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值