Ubuntu/Centos 安装postgresql 10
- OS-Version:
- ubuntu 14.04 / 16.04 / 18.04
- centos 6 / 7
开始安装
- Ubuntu :
sudo vim /etc/apt/sources.list.d/pgdg.list
粘贴下面的到上面打开的文件
ubuntu: 14.04:
deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
ubuntu: 16.04:
deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
ubuntuL 18.04:
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-10 -y
// 安装potgis
apt install postgresql-10-postgis-2.4 -y
- Centos:
- centos 6
sudo yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm
sudo yum install postgresql10
sudo yum install postgresql10-server
sudo service postgresql-10 initdb
sudo chkconfig postgresql-10 on
sudo service postgresql-10 start
- centos 7
sudo yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
sudo yum install postgresql10
sudo yum install postgresql10-server
/usr/pgsql-10/bin/postgresql-10-setup initdb
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10