Quantcast
Channel: How to uninstall specific versions of Postgres? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 3

How to uninstall specific versions of Postgres?

$
0
0

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 updatesudo 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 status9.3/main (port 5432): down9.4/main (port 5434): online9.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"?

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images