Skip to content

Instantly share code, notes, and snippets.

@BhautikChudasama
Last active May 14, 2022 05:30
Show Gist options
  • Select an option

  • Save BhautikChudasama/793c1dd5ce63b6b8c6c98cabec6a9c76 to your computer and use it in GitHub Desktop.

Select an option

Save BhautikChudasama/793c1dd5ce63b6b8c6c98cabec6a9c76 to your computer and use it in GitHub Desktop.

Uninstall

sudo apt-get --purge remove postgresql
sudo apt-get purge postgresql*
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/

Installation In Ubuntu

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 -y install postgresql-13

Connection

sudo su - postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment