Skip to content

Instantly share code, notes, and snippets.

@zenius
Last active September 1, 2019 08:10
Show Gist options
  • Select an option

  • Save zenius/9002af5207c9059e7fb2cd79ce273e78 to your computer and use it in GitHub Desktop.

Select an option

Save zenius/9002af5207c9059e7fb2cd79ce273e78 to your computer and use it in GitHub Desktop.
// switch to root
// create the file as below
nano /etc/apt/sources.list.d/pgdg.list
// save the link in above file:
deb http://apt.postgresql.org/pub/repos/apt/ your_debian_version-pgdg main
// import the repository signing key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
// update the package list
apt-get update
// install postgres
apt install postgresql-version_you_want_to_install
// start postgressql
systemctl start postgresql
// change password
sudo -u postgres psql postgres
postgres=# \password postgres
Enter new password: set_your_new_password_here
Enter it again: enter_your_new_password_again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment