Created
January 16, 2025 16:49
-
-
Save vprasadreddy/f9bb69038f80750cd1384a2516053be1 to your computer and use it in GitHub Desktop.
remove-postgresql-from-ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Uninstall the PostgreSQL application | |
| sudo apt-get --purge remove postgresql postgresql-doc postgresql-common | |
| # Remove PostgreSQL packages | |
| dpkg -l | grep postgres | |
| sudo apt-get --purge remove <package_name> | |
| #Remove PostgreSQL directories | |
| sudo rm -rf /var/lib/postgresql/ | |
| sudo rm -rf /var/log/postgresql/ | |
| sudo rm -rf /etc/postgresql/ | |
| # Remove the postgres user | |
| sudo deluser postgres | |
| # Verify uninstallation | |
| psql --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment