sudo apt-get purge postgresql-9.5

On Ubuntu 14.04 I have done this to get the latest postgres:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade

Then I installed version 9.4:

sudo apt-get install postgresql-9.4

However it seems I have now three versions:

sudo service postgresql stop

 * Stopping PostgreSQL 9.3 database server  [ OK ]
* Stopping PostgreSQL 9.4 database server [ OK ]
* Stopping PostgreSQL 9.5 database server [ OK ]

How can I keep only 9.4 and uninstall the other ones? Thanks

UPDATE:

As suggested in comments I have uninstalled 9.3 and 9.5.

But when I do this:

sudo service postgresql status
9.3/main (port 5432): down
9.4/main (port 5434): online
9.5/main (port 5433): down

So far so good, but when I switch to postgres:

sudo su postgres

and do a psql, I get an error:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

---------------------------------------------------------------------------------

Different versions of PostgreSQL are located in the packages postgresql-9.*.

  1. So you should remove your two packages:

    sudo apt-get purge postgresql-9.3 postgresql-9.5
  2. Then you should remove unnecessary config folders:

    rm -r /etc/postgresql/9.3/ /etc/postgresql/9.5
  3. And from /var/lib/ folder if you have:

    /var/lib/postgresql/*

I hope it will help you.

最新文章

  1. javaSE学习路线
  2. 基于MVC4+EasyUI的Web开发框架形成之旅--权限控制
  3. Solr5.0源码分析-SolrDispatchFilter
  4. vs-ps combination error
  5. 远程复制 scp命令
  6. OS X EI Capitan 10.11.1快速升级方法介绍
  7. Jsp分页实例---真分页
  8. 两个div横向排列,顶端对齐的方式。
  9. eclipse启动报错the catalog could not be loaded please ensure that you have network access and if needed have configured your network proxy
  10. 《从Paxos到ZooKeeper分布式一致性原理与实践》学习笔记
  11. vue.js 视频教程
  12. spring整合curator实现分布式锁
  13. MongoDB update修改器: 针对Fields的$修改器 $inc $set $unset
  14. RHEL7安装图像化桌面
  15. 登录窗口不是系统主窗口 但又需要最先显示 用delphi怎么编写代
  16. redis 任务队列
  17. cloudera manager安装hive注意事项,提示连不上数据库,没有user目录权限
  18. ie下的bug之button
  19. (新)解决php版本ueditor中动态配置图片URL前缀(imageurlprefix)的方法
  20. php二维数组去除重复值

热门文章

  1. Silverlight环境配置
  2. 关于defineProperty
  3. dutacm.club_1094_等差区间_(线段树)(RMQ算法)
  4. VR虚拟红包的技术实现
  5. 网站卡测试用 PageSpeed Insights
  6. CAD保存文件为各种格式
  7. java的标识符和关键词
  8. libevent reference Mannual V -- Bufferevents
  9. html option选中 回显 取值
  10. buf.writeInt16BE()函数详解