当前位置:   article > 正文

Ubuntu 18.04 安装 Postgresql 13 + Postgis 及其相关组件 + pgAdmin 4_ubuntu apt 安装postgresql13

ubuntu apt 安装postgresql13

Postgresql 13

1.官网:https://www.postgresql.org/download/linux/ubuntu/

2.打开终端输入如下命令:

  • sudo sh -c ‘echo “deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main” > /etc/apt/sources.list.d/pgdg.list’
  • wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  • sudo apt-get update
  • sudo apt-get -y install postgresql-13

3.更改用户密码

  • sudo -u postgres psql
    进入数据库后

  • postgres=# ALTER USER postgres WITH PASSWORD ‘123456’;

  • postgres=# \q

  • sudo su

  • sudo passwd -d postgres

  • sudo -u postgres passwd

  • /etc/init.d/postgresql restart

Postgis

1.官网:https://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS24UbuntuPGSQL10Apt
2.打开终端输入如下命令:

  • sudo sh -c ‘echo “deb http://apt.postgresql.org/pub/repos/apt bionic-pgdg main” >> /etc/apt/sources.list’
  • wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
  • sudo apt update
  • sudo apt install postgis
  • sudo apt install postgresql-13-pgrouting
  • sudo apt install postgis-gui

pgAdmin 4

1.官网:https://www.pgadmin.org/download/pgadmin-4-apt/
2.打开终端输入如下命令:

  • curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
  • sudo sh -c ‘echo “deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] http://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main” > /etc/apt/sources.list.d/pgadmin4.list && apt update’
  • sudo apt install pgadmin4
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号