How to install Postgresql 13 on Ubuntu 20.04

The following commands will help you quickly install Postgresql latest version 13 or a custom version on your Ubuntu/Debian machine

sudo sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - | sudo apt-key add -
sudo apt-get update
# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt-get -y install postgresql

Of course you can also install some other packages that would help during software development or usage:

postgresql-client-12 : client libraries and client binaries
postgresql-contrib-9.x : additional supplied modules (part of the postgresql-xx package in version 10 and later)
libpq-dev : libraries and headers for C language frontend development
postgresql-server-dev-12 : libraries and headers for C language backend development
pgadmin4 : pgAdmin 4 graphical administration utility

Add to my src(0)

No account yet? Register