프로그래밍
리눅스 offline 으로 인터넷 연결 없이 PostgreSQL DB 설치하기
대도루피
2022. 12. 13. 12:54
반응형
가끔 인터넷이 안되는 환경에 PostgreSQL 을 설치해야 하는 경우가 있습니다.
매번 검색하기는 어려우니 그때를 위해 정리해봅니다.
순서는 curl 로 파일을 다운로드 받고
yum localinstall 로 rpm 을 설치하고
db init 해주고
service 에 등록.. 하면 끝.
4개 파일만 복사해서 가지고 가면 쉽게 작업 가능!
$ curl -O https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/postgresql11-libs-11.18-1PGDG.rhel8.x86_64.rpm
$ curl -O https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/postgresql11-11.18-1PGDG.rhel8.x86_64.rpm
$ curl -O https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/postgresql11-server-11.18-1PGDG.rhel8.x86_64.rpm
$ curl -O https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/postgresql11-contrib-11.18-1PGDG.rhel8.x86_64.rpm
$ yum localinstall postgresql11-libs-11.18-1PGDG.rhel8.x86_64.rpm
$ yum localinstall postgresql11-11.18-1PGDG.rhel8.x86_64.rpm
$ yum localinstall postgresql11-server-11.18-1PGDG.rhel8.x86_64.rpm
$ yum localinstall postgresql11-contrib-11.18-1PGDG.rhel8.x86_64.rpm
$ /usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database ... OK
$ systemctl enable postgresql-11.service
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-11.service → /usr/lib/systemd/system/postgresql-11.service.
$ systemctl start postgresql-11.service
반응형