1 - Create the file /etc/apt/sources.list.d/pgdg.list
and add a line for the repository
deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
2 - Import the repository signing key, and update the package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
3 - install posgtresql
sudo apt-get install postgresql-12 postgresql-client-12 postgresql-12 postgresql-contrib libpq-dev postgresql-server-dev-12
4 - install pgadmin 4
sudo apt-get install pgadmin4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package pgadmin4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'pgadmin4' has no installation candidate