13

Basically, follow the steps as outlined here: https://wiki.postgresql.org/wiki/Apt.

  1. sudo apt-get install curl ca-certificates gnupg
  2. curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  3. sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
  4. sudo apt-get update
  5. sudo apt-get install pgadmin4

(The actual command for the last step includes postgresql-11. I never do that because I just want pgadmin4 and have never had issues with it working properly.)

Anyway, this is what happens when trying to install:

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

I've redone the steps with the same result.

I did also try to do the following, but it requires python3.7 which I'm not going to install.

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt eoan-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Verified focal shows up at apt.postgresql.org:

enter image description here

Kind of stumped after that as to what to do.

Suggestions?

  • 2
    I'm having the same issue. The reason why is that the focal packages don't have pgAdmin4 yet. You can confirm this if you check the packages file in the main folder of focal-pgdg/. Like you, I tried getting it from the eoan packages, but asked for python3.7. What I'm confused about is that I did install libpython3.8, but it doesn't recognize it. askubuntu.com/questions/1230387/… – ShrimpCrackers Apr 24 at 18:13
  • I wrote a short post explaining how to use the dockerized pgAdmin4 with a local Postgres server on Ubuntu 20.04. Apparently, it's not that straightforward. dragoshmocrii.com/… – Dragos Apr 27 at 16:03
9

I was able to install pgadmin4 on ubuntu 20.04 (focal fossa) using the following article as a base: https://linuxhint.com/install-pgadmin4-ubuntu/

A few changes to the instructions are required:

  1. In part 2:

    sudo apt-get install build-essential libssl-dev libffi-dev libgmp3-dev
    sudo apt-get install python3-virtualenv libpq-dev python3-dev
    
  2. In part 5:
    The latest version for the moment is:

    https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.20/pip/pgadmin4-4.20-py2.py3-none-any.whl
    

    (I used release, not a daily snapshot)

  3. In part 6: Use

    pip install pgadmin4-4.20-py2.py3-none-any.whl 
    
  4. In part 7:
    Use 'python3.8' instead of 'python2.7'

That's all.
Worked for me.

| improve this answer | |
  • Does virtual env is necessary? If so, can I ask why? – Sarthak May 5 at 7:19
  • 1
    @Sarthak Using virtual environment isn't necessary. You can install pgadmin4 as your local package (e.g. at ~/.local/lib/python3.8/site-packages/pgadmin4) instead of installing in a virtual environment. – Ajeet Shah May 11 at 13:02
  • An installation of a virtual env it is not a requierimiend, but it's strongly recommended, please read the notes: pgadmin.org/download/pgadmin-4-python-wheel – lestcape May 14 at 1:14
5

Update: Please note that it's possible install pgadmin4 (4.21) directly from the repositories now.

The problem of the upstream debian repository was the python 3.8 support. They said that was fixed in this commit, but they are apparently missing this: https://github.com/postgres/pgadmin4/commit/b7dad25d3eb29fae05fef4f161dea644f080276f

Also the upstream has no support for Ubuntu 20.04 yet. See the status at this date (2020-05-13): https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/

If someone were to distribute pgadmin4 directly in Ubuntu it would be really helpfully, but it is not available yet.

| improve this answer | |
  • How long does it usually take for these changes to be released? – ShrimpCrackers Apr 25 at 5:33
  • I think it will have support in the next version and they release are one per month, more less. So, i suppose the next version 4.21 will be released at the start of the next month and will support python 3.8 and also ubuntu 20.04. But i can not warranty that will be in this way, its a assumption. You can try to install it from source if you can not wait (linuxhint.com/install-pgadmin4-ubuntu). Just reemplace the source and use the last available (ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2020-04-26/…). – lestcape Apr 26 at 5:08
  • a new version v4.21 of PgAdmin was released on 04-30-20, but it still does not support Ubuntu 20.04 – Ait Yahia Idir May 1 at 21:29
  • 1
    The issue with python3.8 was fixed, they just need to update the repository now because they have the version 4.16-1 and what they need to have is the 4.21. As i already said i can not warranty that will be in this way. Even more intresting Fedora 32 was released after Ubuntu 20.04 and now it have an snapshot while ubuntu 20.04 not. What can i said? It's a human factor. – lestcape May 1 at 21:59
  • It was update to 4.21 now, so can be installed directly from the repository. – lestcape May 14 at 1:15
1

As a workaround you could run pgadmin4 in docker

docker run -p 5050:80 \
-e 'PGADMIN_DEFAULT_EMAIL=THE_EMAIL_YOU_WANT_TO_USE' \
-e 'PGADMIN_DEFAULT_PASSWORD=XXXXX' \
-d dpage/pgadmin4

Then point your browser to http://localhost:5050

| improve this answer | |
  • 1
    Just note that if you want to connect to a postgres running on your local machine you shouldn't use localhost as the server's address but the ip of your pc. – apanagio Apr 27 at 8:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.