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

You should now be able to:

apt-get install postgresql

or for a complete install:

apt-get install postgresql-8.4 postgresql-contrib-8.4 postgresql-doc-8.4

完全删除Postgresql的更多相关文章

  1. debian命令行删除postgresql数据库

    创建数据库 $ createdb odoo-test 删除数据库 $ dropdb odoo-test

  2. REFRESH删除POSTGRESQL

    sudo apt-get install python-psycopg2sudo apt-get install postgresql sudo su - postgres createuser -- ...

  3. win7 注册删除postgresql服务

    注册服务 删除服务 备注:都以管理员身份运行dos

  4. PostgreSQL 删除数据库

    PostgreSQL 删除数据库可以用以下三种方式: 1.使用 DROP DATABASE SQL 语句来删除. 2.使用 dropdb 命令来删除. 3.使用 pgAdmin 工具. 注意:删除数据 ...

  5. ubuntu下postgreSQL安装配置

    一.安装并配置,并设置远程登陆的用户名和密码 1.安装postgreSQL sudo apt-get update sudo apt-get install postgresql-9.4 在Ubunt ...

  6. Ubuntu下postgresql安装

    第一步:在Ubuntu下安装Postgresql         1.使用 apt-get install 安装          zhang@ubuntu:~/protgresql#sudo apt ...

  7. CentOS安装postgresql 9.4

    第一步:在CentOS6.5下安装Postgresql 1. 安装PostgreSQL源 # yum install http://yum.postgresql.org/9.4/redhat/rhel ...

  8. Ubuntu 16.04 卸载Postgresql

    首先确保postgresql是否在运行,在命令窗口输入 netstat -nlt han@han-OptiPlex-:~/project/0_ng_practice/ng-test$ netstat ...

  9. 卸载postgresql数据库

    卸载postgresql数据库有两种方法,第一种一个个包卸载,第二种全部卸载.做这些之前请先做好备份,以防意外! 1.1.查询出postgres数据库,用命令rpm -qa |grep postgre ...

随机推荐

  1. 2013Esri全球用户大会之互操作和标准

    1:Esri在开源领域做过哪些工作? Esri一直以来就是开源技术的用户和支持者.我们相信,通过提供从上到下的开放平台可使我们的用户成为开发能力强大的解决方案的积极参与者.在现有技术形势下,我们正在将 ...

  2. XAF-列表视图数据访问模式

    本主题介绍有关列表视图如何提供数据访问的几种方式.请注意,选择正确的方式对于实现XAF应用程序的最佳性能至关重要.    数据访问模式概述   在模型编辑器中,通过 视图-> <ListV ...

  3. 关于CachedRowSetImpl类

    全称: com.sun.rowset.CachedRowSetImpl 父类: javax.sql.rowset.BaseRowSet 实现的接口: javax.sql.RowSet javax.sq ...

  4. C# 显式创建线程 or 使用线程池线程--new Thread() or ThreadPool.QueueUserWorkItem()

    在C#多线程编程中,关于是使用自己创建的线程(Thread)还是使用线程池(ThreadPool)线程,一直很困惑,知道看了Jeffrey Richter的相关介绍才明白,记录如下: 当满足一下任何条 ...

  5. Python快捷键

    IDLE默认不能显示行号,使用ALT+G 跳到对应行号,在右下角有显示光标所在行.列. ALT+P  上一个历史输入内容. ALT+N 下一个历史输入内容. IDLE中按F5可以运行代码.

  6. svn 常用控制台命令解析

    参数说明 :serverPath:表示服务器的文件路径 ,  localPath:表示本地的文件路径  , num 表示数字 , edition1:表示工程已经跟新的版本1 , edition2:表示 ...

  7. Android使用Home键后应用程序重启的问题

    正常情况应该是在点击 home 按键后,程序在后台暂停运行,点击 后退键 才会退出应用的,但是今天遇到个问题,点击 home 键后,重新再打开应用却每次都返回应用启动页面,有些莫名其妙,一番googl ...

  8. niceScroll接口大全

    Query滚动条插件兼容ie6+.手机.ipad http://www.areaaperta.com/nicescroll/ jQuery(function($){ $("#scrollIn ...

  9. python字符串及正则表达式[转]

    原文链接:http://www.cnblogs.com/guojidong/archive/2012/12/20/2826388.html 字符串: 正则表达式 正则表达式元字符与语法图: 注意事项: ...

  10. vultr优惠码ssd vps赠送50美金,长期有效

    vultr最新优惠码.vultr vps注册教程,是大家关心的问题.网上流传很多vultr vps优惠码,鱼龙混杂,难以判断.其实,获取vultr优惠赠送美元的方式很简单. 第一种,新用户使用绑定信用 ...