프린트 하기 URL 복사

OS 환경 : Oracle Linux 9.6 (64bit)

 

DB 환경 : PostgreSQL 18.6

 

방법 : Oracle Linux 9.6에 PostgreSQL 18 설치 가이드

Oracle Linux 9에 PostgreSQL 18을 설치하려고 공식 메뉴얼을 보고 설치시도 해보았음
https://www.postgresql.org/download/linux/redhat/
위 링크에 있는 명령어로 설치해봄, 참고로 OEL 8.4에 PostgreSQL 16 설치하는 방법과 거의 동일하였음(PostgreSQL built-in 모듈 비활성화하는 부분만 없어짐)
참고 : Oracle Linux 8.4에 PostgreSQL 16 설치 가이드 ( https://positivemh.tistory.com/1041 )

 

 

PostgreSQL용 repository RPM 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Oracle Linux 9 BaseOS Latest (x86_64)                                                                                                8.2 kB/s | 4.3 kB     00:00
Oracle Linux 9 BaseOS Latest (x86_64)                                                                                                 17 MB/s | 149 MB     00:08
Oracle Linux 9 Application Stream Packages (x86_64)                                                                                   12 kB/s | 4.5 kB     00:00
Oracle Linux 9 Application Stream Packages (x86_64)                                                                                   19 MB/s | 106 MB     00:05
Oracle Linux 9 UEK Release 8 (x86_64)                                                                                                8.2 kB/s | 3.5 kB     00:00
Oracle Linux 9 UEK Release 8 (x86_64)                                                                                                 18 MB/s |  60 MB     00:03
Last metadata expiration check: 0:00:11 ago on Sat 12 Sep 2026 02:53:12 PM KST.
pgdg-redhat-repo-latest.noarch.rpm                                                                                                   353 kB/s |  13 kB     00:00
Dependencies resolved.
=====================================================================================================================================================================
 Package                                   Architecture                    Version                                       Repository                             Size
=====================================================================================================================================================================
Installing:
 pgdg-redhat-repo                          noarch                          42.0-66.rhel9PGDG                             @commandline                           13 k
 
Transaction Summary
=====================================================================================================================================================================
Install  1 Package
 
Total size: 13 k
Installed size: 16 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                             1/1
  Installing       : pgdg-redhat-repo-42.0-66.rhel9PGDG.noarch                                                                                                   1/1
  Verifying        : pgdg-redhat-repo-42.0-66.rhel9PGDG.noarch                                                                                                   1/1
 
Installed:
  pgdg-redhat-repo-42.0-66.rhel9PGDG.noarch
 
Complete!

repo 설치완료

 

 

PostgreSQL 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# dnf install -y postgresql18-server
PostgreSQL common RPMs for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                 1.4 kB/s | 659  B     00:00
PostgreSQL common RPMs for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                 2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
PostgreSQL common RPMs for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                 2.8 MB/s | 914 kB     00:00
PostgreSQL 18 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          9.0 kB/s | 659  B     00:00
PostgreSQL 18 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
PostgreSQL 18 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.2 MB/s | 799 kB     00:00
PostgreSQL 17 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          1.4 kB/s | 659  B     00:00
PostgreSQL 17 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
PostgreSQL 17 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          8.3 MB/s | 1.3 MB     00:00
PostgreSQL 16 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          8.8 kB/s | 659  B     00:00
PostgreSQL 16 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
PostgreSQL 16 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          4.7 MB/s | 1.5 MB     00:00
PostgreSQL 15 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          8.4 kB/s | 659  B     00:00
PostgreSQL 15 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
PostgreSQL 15 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          5.5 MB/s | 1.8 MB     00:00
PostgreSQL 14 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.6 kB/s | 659  B     00:00
PostgreSQL 14 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
PostgreSQL 14 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          7.7 MB/s | 2.1 MB     00:00
Dependencies resolved.
=====================================================================================================================================================================
 Package                                       Architecture                     Version                                       Repository                        Size
=====================================================================================================================================================================
Installing:
 postgresql18-server                           x86_64                           18.6-1PGDG.rhel9.8                            pgdg18                           7.3 M
Installing dependencies:
 postgresql18                                  x86_64                           18.6-1PGDG.rhel9.8                            pgdg18                           2.0 M
 postgresql18-libs                             x86_64                           18.6-1PGDG.rhel9.8                            pgdg18                           304 k
 
Transaction Summary
=====================================================================================================================================================================
Install  3 Packages
 
Total download size: 9.5 M
Installed size: 43 M
Downloading Packages:
(1/3): postgresql18-18.6-1PGDG.rhel9.8.x86_64.rpm                                                                                     22 MB/s | 2.0 MB     00:00
(2/3): postgresql18-libs-18.6-1PGDG.rhel9.8.x86_64.rpm                                                                               1.1 MB/s | 304 kB     00:00
(3/3): postgresql18-server-18.6-1PGDG.rhel9.8.x86_64.rpm                                                                             5.3 MB/s | 7.3 MB     00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                7.0 MB/s | 9.5 MB     00:01
PostgreSQL 18 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64                                                                          2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                             1/1
  Installing       : postgresql18-libs-18.6-1PGDG.rhel9.8.x86_64                                                                                                 1/3
  Running scriptlet: postgresql18-libs-18.6-1PGDG.rhel9.8.x86_64                                                                                                 1/3
  Installing       : postgresql18-18.6-1PGDG.rhel9.8.x86_64                                                                                                      2/3
  Running scriptlet: postgresql18-18.6-1PGDG.rhel9.8.x86_64                                                                                                      2/3
  Running scriptlet: postgresql18-server-18.6-1PGDG.rhel9.8.x86_64                                                                                               3/3
Creating group 'postgres' with GID 26.
Creating user 'postgres' (PostgreSQL Server) with UID 26 and GID 26.
 
  Installing       : postgresql18-server-18.6-1PGDG.rhel9.8.x86_64                                                                                               3/3
  Running scriptlet: postgresql18-server-18.6-1PGDG.rhel9.8.x86_64                                                                                               3/3
  Verifying        : postgresql18-18.6-1PGDG.rhel9.8.x86_64                                                                                                      1/3
  Verifying        : postgresql18-libs-18.6-1PGDG.rhel9.8.x86_64                                                                                                 2/3
  Verifying        : postgresql18-server-18.6-1PGDG.rhel9.8.x86_64                                                                                               3/3
 
Installed:
  postgresql18-18.6-1PGDG.rhel9.8.x86_64            postgresql18-libs-18.6-1PGDG.rhel9.8.x86_64            postgresql18-server-18.6-1PGDG.rhel9.8.x86_64
 
Complete!

Postgresql 패키지 설치 완료

 

 

DB 초기화 및 자동 기동 설정(선택사항)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# /usr/pgsql-18/bin/postgresql-18-setup initdb
Initializing database ... OK
 
# systemctl enable postgresql-18
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-18.service → /usr/lib/systemd/system/postgresql-18.service.
 
# systemctl start postgresql-18
 
# systemctl status postgresql-18
● postgresql-18.service - PostgreSQL 18 database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql-18.service; enabled; preset: disabled)
     Active: active (running) since Sat 2026-09-12 14:54:20 KST; 1 day 1h ago
       Docs: https://www.postgresql.org/docs/18/static/
    Process: 3040 ExecStartPre=/usr/pgsql-18/bin/postgresql-18-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
   Main PID: 3050 (postgres)
      Tasks: 10 (limit: 50368)
     Memory: 33.3M
        CPU: 25.060s
     CGroup: /system.slice/postgresql-18.service
             ├─3050 /usr/pgsql-18/bin/postgres -D /var/lib/pgsql/18/data/
             ├─3051 "postgres: logger "
             ├─3052 "postgres: io worker 0"
             ├─3053 "postgres: io worker 1"
             ├─3054 "postgres: io worker 2"
             ├─3055 "postgres: checkpointer "
             ├─3056 "postgres: background writer "
             ├─3058 "postgres: walwriter "
             ├─3059 "postgres: autovacuum launcher "
             └─3060 "postgres: logical replication launcher "
 
Sep 12 14:54:20 oel9 systemd[1]: Starting PostgreSQL 18 database server...
Sep 12 14:54:20 oel9 postgres[3050]: 2026-09-12 14:54:20.761 KST [3050] LOG:  redirecting log output to logging collector process
Sep 12 14:54:20 oel9 postgres[3050]: 2026-09-12 14:54:20.761 KST [3050] HINT:  Future log output will appear in directory "log".
Sep 12 14:54:20 oel9 systemd[1]: Started PostgreSQL 18 database server.

 

 

postgres 유저로 접속 후 버전 확인

1
2
3
4
5
6
7
8
9
10
11
12
# su - postgres
$ psql --version
psql (PostgreSQL) 18.6
$ psql
psql (18.6)
Type "help" for help.
 
postgres=# select version();
                                                  version
-----------------------------------------------------------------------------------------------------------
 PostgreSQL 18.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-14), 64-bit
(1 row)

정상적으로 PostgreSQL 18.6이 설치됨

 

 

참조 :
https://www.postgresql.org/download/linux/redhat/
Oracle Linux 8.4에 PostgreSQL 16 설치 가이드 ( https://positivemh.tistory.com/1041 )
https://wikidocs.net/184222