Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stiwardjherikofcr/e2f3a7f5427c14c451106fa31bd92981 to your computer and use it in GitHub Desktop.
Save stiwardjherikofcr/e2f3a7f5427c14c451106fa31bd92981 to your computer and use it in GitHub Desktop.
How To Completely Uninstall PostgreSQL || Ubuntu 20.04 LTS
# Step 1 — List All Postgres related packages
dpkg -l | grep postgres
# Step 2 — Remove all current Postgresql related packages
sudo apt --purge remove postgresql*
# Step 3 — Remove all of the PostgreSQL data and directories
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
# Step 4 — Remove the postgres user
sudo deluser postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment