微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

完全卸载postgresql

First: If your install isn't already damaged, you can drop unwanted Postgresql servers ("clusters") in Ubuntu using pg_dropcluster. Use that in preference to a full purge and reinstall if you just want to start with a freshly initdb'd Postgresql instance.

If you really need to do a full purge and reinstall, first make sure Postgresql isn't running. ps -C postgres should show no results.

Now run:

apt-get --purge remove postgresql\*

to remove everything Postgresql from your system. Just purging the postgres package isn't enough since it's just an empty Meta-package.

Once all Postgresql packages have been removed, run:

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

然后就可以重新安装新的postgresql

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐