Postgresql10離線安裝方法


  • 在聯網的機器上安裝postgresql yum 源官網鏈接
[root@localhost yum.repos.d]# yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm

或者

[root@localhost]# wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-42.0-4.noarch.rpm
[root@localhost]# rpm -ivh pgdg-redhat-repo-42.0-4.noarch.rpm
  • 替換$releasever為系統版本號
[root@localhost yum.repos.d]# sed -i 's/$releasever/6/g' /etc/yum.repos.d/pgdg-redhat-all.repo
  • 安裝依賴
[root@localhost]# yum install --downloadonly --downloaddir=psql10 libicu postgresql10-libs
  • 安裝軟件包
[root@localhost]# yum install --downloadonly --downloaddir=psql10 postgresql10 postgresql10-server
  • 初始化數據庫並啟用自動啟動:
service postgresql-10 initdb 
chkconfig postgresql-10 on 
service postgresql-10 start
  • 離線安裝下載完成的rpm
[root@bogon psql10]# ll
總用量 12208
-rw-r--r-- 1 root root 5157464 7月  23 2019 libicu-4.2.1-14.el6.x86_64.rpm
-rw-r--r-- 1 root root 1702904 7月  23 2019 postgresql10-10.9-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root  333504 7月  23 2019 postgresql10-libs-10.9-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root 5299092 7月  23 2019 postgresql10-server-10.9-1PGDG.rhel6.x86_64.rpm
  • 使用數據庫
su - postgres
psql


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM