最先是从官网安装: https://www.postgresql.org/download/linux/debian/
版本选择:debia
1, stretch(9.x)
2, Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository:
deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main
3,Import the repository signing key, and update the package lists:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
4, apt-get install postgresql-10
在更新本地包的时候,有一个地址链接不到,按install的时候,就提示没有包,
又从Install PostgreSQL 10 on Debian 9
,安装这个步骤安装了,
$ wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
$ sudo sh -c 'echo "d