How to Uninstall Postgresql in Ubuntu

I. Problem

I would like to install multiple versions of PostgreSQL on my machine. Currently, I have version 11 installed.

II. Solution

In Windows, you can easily install several versions of PostgreSQL and start the one you need in services.msc. It's not as simple in Ubuntu, the latest version always takes precedence. So I'll be using a docker image instead. But how to uninstall PostgreSQL in Ubuntu?
# List all the packages related to postgres
dpkg -l | grep postgres

# It should output all the postgres versions installed on your machine. 
# For example postgresql-10, postgresql-11
# Purge and remove these packages by executing
sudo apt-get --purge remove postgresql*

# Verify if remove is successful
dpkg -l | grep postgres

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →