본문 바로가기
카테고리 없음

[Rocky Linux 9.5] Local Repository 연결 및 postgresql offline 설치 테스트

by Hwoarang757 2025. 6. 15.

(1) Rocky Linux 9.5 Full ISO 를 mount 먼저 진행 하였습니다.

$ sudo blkid 

// DVD ROM 경로 확인

# sudo mount /dev/sr0 /mnt

 

(2) local-rocky.repo 라는 명칭으로 repository 정보를 작성 하였습니다.

ISO 이미지에서 GPG 키를 찾을 수 없어서 /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 파일의 경로를 명시 해 주었습니다.

$ sudo vi /etc/yum.repos.d/local-rocky.repo

[local-baseos]
name=Rocky Linux 9.5 Local Repo - BaseOS
baseurl=file:///mnt/BaseOS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9

[local-appstream]
name=Rocky Linux 9.5 Local Repo - AppStream
baseurl=file:///mnt/AppStream/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9

 

(3) local repository로 vim 설치 테스트를 진행 해보았습니다.

$ sudo dnf clean all

$ sudo dnf makecahe

$ sudo dnf install vim

 

 

(4) postgresql rpm 설치 패키지 다운로드 진행 

https://download.postgresql.org/pub/repos/yum/16/redhat/rhel-9-x86_64/

 

Index of /pub/repos/yum/16/redhat/rhel-9-x86_64/

 

download.postgresql.org

해당 사이트에서 현재 가장 최신 버젼의 rpm을 받았습니다.

postgresql15-15.13-2PGDG.rhel9.x86_64.rpm

postgresql15-contrib-15.13-2PGDG.rhel9.x86_64.rpm

postgresql15-libs-15.13-2PGDG.rhel9.x86_64.rpm

postgresql15-server-15.13-2PGDG.rhel9.x86_64.rpm

 

(5) 파일을 offline 서버에 복사 하여 rpm 패키지를 설치 진행 하였습니다.

$ sudo dnf install *.rpm

 

(6) postgresql 서비스 활성화 및 접속을 시도 하였습니다.

 

$ sudo systemctl enable postgresql-15

$ sudo systemctl start postgresql-15

 # 서비스 실패로 , 로그 확인 시에 /usr/pgsql-15/bin/postgresql-15-setup initdb 명령을 실행하라는 메시지가 있어 실행 하였습니다.

$ sudo /usr/pgsql-15/bin/postgresql-15-setup initdb

$ sudo systemctl start postgresql-15

 

# postgresql 접속 테스트

$ sudo  -i -u postgres

$ psql