Ubuntu18.04安裝postgresql-10


Ubuntu18安裝postgresql-10

最近切換Ubuntu作為辦公系統,所有軟件安裝都要重來一遍。

官方文檔: https://www.postgresql.org/download/linux/ubuntu/

查看系統版本

~  lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

我的系統是 bionic, 其他還有xenial(16), trusty(14).

創建resource源

vim /etc/apt/sources.list.d/pgdg.list 

deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main

導入key

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

可以安裝以下軟件

name desc
postgresql-client-10 client libraries and client binaries
postgresql-10 core database server
postgresql-contrib-9.x additional supplied modules (part of the postgresql-xx package in version 10 and later)
libpq-dev libraries and headers for C language frontend development
postgresql-server-dev-10 libraries and headers for C language backend development
pgadmin4 pgAdmin 4 graphical administration utility

安裝

sudo apt-get install postgresql-10  pgadmin4

安裝之后

安裝完畢已經啟動,可以修改下密碼:

sudo su postgres
ALTER USER postgres WITH PASSWORD '新密碼'; 

安裝完的目錄: /var/lib/postgresql/10

然后其他配置類似centos7: https://www.cnblogs.com/woshimrf/p/centos-install-postgresql.html

啟動pgadmin

Ubuntu上navicate貌似不好裝,使用官方pgadmin4

sudo find / -name pgAdmin4

## 啟動
pgAdmin4


免責聲明!

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



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