Ubuntu16部署postgresql9、11及卸载
1、postgresql9.6
添加官方源:
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
导入仓库:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
更新安装包列表:
sudo apt-get update
安装:
sudo apt-get install postgresql-9.6
2、postgresql11
添加官方源:
sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list main"
导入仓库:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
更新安装包列表:
sudo apt-get update
安装:
apt-get install postgresql-11
卸载pg:
apt-get --purge remove postgresql\*
rm -r /etc/postgresql/
rm -r /etc/postgresql-common/
rm -r /var/lib/postgresql/