把Postgresql的deb包链接添加到apt源中:
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 -
更新apt源:
sudo apt update
安装最新版本Postgresql,如果要指定版本,用postgresql-12或类似的代替
sudo apt -y install postgresql