Recently switched to Ubuntu as an office system, all software installations have to be repeated.
Official document: https://www.postgresql.org/download/linux/ubuntu/
View system version
~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release:18.04
Codename: bionic
My system is bionic, there are other xenial(16), trusty(14).
Create resource source
vim /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
Import key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
The following software can be installed
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 |
installation
sudo apt-get install postgresql-10 pgadmin4
After the installation is started, the password can be changed:
sudo su postgres
ALTER USER postgres WITH PASSWORD 'new password';
Installed directory: /var/lib/postgresql/10
Then other configurations are similar to centos7: https://www.cnblogs.com/woshimrf/p/centos-install-postgresql.html
Navicate seems to be difficult to install on Ubuntu, use official pgadmin4
sudo find /-name pgAdmin4
## start up
pgAdmin4
Recommended Posts