Ubuntu 16.04 卸载Postgresql

首先确保postgresql是否在运行,在命令窗口输入 netstat -nlt

han@han-OptiPlex-7050:~/project/0_ng_practice/ng-test$ netstat -nlt
激活Internet连接 (仅服务器) Proto Recv
-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:63342 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:8081 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:5939 0.0.0.0:* LISTEN tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:1080 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:4200 0.0.0.0:* LISTEN tcp6 0 0 ::1:631 :::* LISTEN

如果在运行,默认的5432端口就能被监听到,请运行 sudo service postgresql stop 暂停服务。

在命令行输入 

sudo apt-get --purge remove postgresql

删除postgresql安装包,安装删除后还有删除对应的配置

sudo rm -r /etc/postgresql/
sudo rm -r /etc/postgresql-common/
sudo rm -r /var/lib/postgresql/
sudo userdel -r postgres
sudo groupdel postgres

到此,postgresql就从电脑中完全删除了.

参考:https://stackoverflow.com/questions/2748607/how-to-thoroughly-purge-and-reinstall-postgresql-on-ubuntu

 

转载于:https://www.cnblogs.com/hanshuai/p/8745952.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值