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. 使用CAShapeLayer绘图

    之前讲过使用UIBezierPath在UIView的drawRect中绘图, 今天我们讲下另外一种方式: CAShaperLayer 先说说使用CAShapeLayer的优点: GPU执行, GPU执 ...

  2. 使用pentaho工具将数据库数据导入导出为Excel

    写在前面:本篇博客讲述的是如何使用pentaho工具快速的将数据库数据导出为Excel文件,以及如何将Excel文件数据导入数据库. 补充:使用此工具并不需要任何一句代码并能快速便捷解决实际问题,此工 ...

  3. [ios2]如何让IOS应用从容地崩溃 【转】

    文/donglin 虽然大家都不愿意看到程序崩溃,但可能崩溃是每个应用必须面对的现实,既然崩溃已经发生,无法阻挡了,那我们就让它崩也崩得淡定点吧. IOS SDK中提供了一个现成的函数 NSSetUn ...

  4. aop为系统添加操作日志,注入或配置声明的方式来实现

    最近做项目实现操作记录添加日志,由于aop这两种实现方式各有优缺点,所以都实现了一下以后根据具体业务选择. 1实现方式一注入: 1.1首先在xml中开启aop注入,需要引入的包此处省略,可百度自己查找 ...

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

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

  6. centos 6.5 安装mysql 5.6错误

    yum list libaio yum install libaio.i686 yum list glibc* yum install glibc.i686 yum list libstdc++* y ...

  7. fpga之显示字符串

    //必须在有效区域下显示颜色才有颜色 显示字符可以在设定一个有效区域内显示 另加两个wire 求出新的x,ymodule vga_fpga( clk,rst_n, vga_b,vga_g,vga_r, ...

  8. IQueryable 和 IEnumerable

    IQueryable 和 IEnumerable 其实,对于上面的即有过虑又有排序的条件查询Linq语句,EF是读取数据库中整个Books表中的数据到内存,还是根据Linq查询语句智能的生成SQL再执 ...

  9. C++内存池

    内存池是一种内存分配方式.通常我们习惯直接使用new.malloc等API申请分配内存,这样做的缺点在于:由于所申请内存块的大小不定,当频繁使用时会造成大量的内存碎片.并由于频繁的分配和回收内存会降低 ...

  10. idea不能加载xml