PostgreSQL/install

1. PostgreSQL RHEL 설치: DNF 패키지 매니저를 이용한 기본 설치

최 재호 2025. 1. 2. 13:35

 

https://www.postgresql.org/download/linux/redhat/

 

#상황에 따라 sudoers 권한을 가진 계정으로 전환

# root 계정으로 전환 (환경에 따라 알맞은 계정으로 접속)
su -

 

# rpm repository 경로를 지정하여 설치 (위 url 참고)

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm

 

###### 위 설치 혹은 이후 명령에서 오류가 나타나면

###### 아래와 같이 문제가 된 부분을 비활성화 해준다.

###### 각 오류 메세지에 맞게끔 명령어를 변경

#오류 내용 예시

#PostgreSQL common testing RPMs for RHEL / Rocky / AlmaLinux 9 - x86_64
#Errors during downloading metadata for repository 'pgdg-common-testing':

sudo dnf config-manager --disable pgdg-common-testing

sudo dnf config-manager --disable pgdg13-updates-testing

sudo dnf config-manager --disable pgdg14-updates-testing

sudo dnf config-manager --disable pgdg15-updates-testing

sudo dnf clean all

sudo dnf makecache

###### 여기까지 첫번째 설치 문제 시 실행 과정

 

# 오류 해결 후 재설치 진행 (오류가 났었던 부분 부터 재실행)

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm

 

# Disable the built-in PostgreSQL module:

sudo dnf -qy module disable postgresql

 

# Install PostgreSQL:

sudo dnf install -y postgresql17-server

 

# Optionally initialize the database and enable automatic start:

sudo /usr/pgsql-17/bin/postgresql-17-setup initdb
sudo systemctl enable postgresql-17
sudo systemctl start postgresql-17
sudo systemctl status postgresql-17

 

기본 설치 완료.

 

2편에 계속

 

 

728x90
반응형