'installing pgadmin4-web on ubuntu desktop 22.04

I have followed this tutorial for installing pgadmin4-web: pgAdmin 4 (APT) .

When I run the following command

sudo /usr/pgadmin4/bin/setup-web.sh 

I get the following error:

Setting up pgAdmin 4 in web mode on a Debian based platform… Creating configuration database… /usr/pgadmin4/bin/setup-web.sh: line 75: /usr/pgadmin4/venv/bin/python3: No such file or directory Error setting up server mode. Please examine the output above.

Any help would be great thanks.

Note:

After run the following command (tutorial´s step two)

sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

I had to change inside file /etc/apt/sources.list.d/pgadmin4.list from jammy to bionic

from
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 main
to
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4 main


Solution 1:[1]

I had a similar problem and couldn't find any solution for the desktop version, in particular, for Ubuntu 22.04 (jammy). However, this should also work for the pgadmin4-web:

sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2022-05-05/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt install pgadmin4-web

(Don't forget to run sudo /usr/pgadmin4/bin/setup-web.sh after that)

For the desktop version just install pgadmin4-desktop instead of pgadmin4-web:

sudo apt install pgadmin4-desktop

Also, please note that this is a temporary solution (May 2022), until the devs release the final pgadmin4 version for jammy. Once it's out, you would just need to update the repository.

Hope this helps.

Solution 2:[2]

Adding to what Shashank outlined using PGAdmin Python virtual environment and run thru web browser.

  1. Follow guidance here
  2. To re-start PGAdmin, from terminal run

$ source pgadmin4/bin/activate
$ pgadmin4
  1. Navigate to http://127.0.0.1:5050 in browser (keep terminal open)

Solution 3:[3]

You can also use Docker to install pgadmin4 on Ubuntu 22.04:

docker pull dpage/pgadmin4
docker run -p 80:80 \
    -e '[email protected]' \
    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \
    -d dpage/pgadmin4

To install docker: https://docs.docker.com/engine/install/ubuntu/

Documentation for container deployment: https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#examples

Solution 4:[4]

I managed to install pgadmin4 from APT on Ubuntu 22.04, but even after that I was facing some issues while starting pgadmin4.

So I found out that there's a python package for pgadmin4 which exists. It will install the web version of the pgadmin4 and it works without any issue.

Follow the below steps to install or you can check this link.

$ sudo mkdir /var/lib/pgadmin
$ sudo mkdir /var/log/pgadmin
$ sudo chown $USER /var/lib/pgadmin
$ sudo chown $USER /var/log/pgadmin

# Create virtual environment
$ python3 -m venv pgadmin4
$ source pgadmin4/bin/activate

# Install pgadmin4
(pgadmin4) $ pip install pgadmin4

# Start pgadmin4
(pgadmin4) $ pgadmin4

For the first time after running pgadmin4, you'll be asked to set the email and password.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 akaine
Solution 2 rcschmid
Solution 3 Louis Huang
Solution 4 Shashank