Re: pgAdmin 4 in web mode on an Ubuntu 20.04 (Focal) system.

From: Daulat <daulat(dot)dba(at)gmail(dot)com>
To: zaidagilist <zaidagilist(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: pgAdmin 4 in web mode on an Ubuntu 20.04 (Focal) system.
Date: 2025-05-22 12:25:12
Message-ID: CALfOM6L6YOkG8E5rot478Z095sMMub2fRZwkbhr+Mn0S8XTfbQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-admin

Thanks Zaid,

I will try the same steps on a new machine later.
For now, I attempted to upgrade pgAdmin from version 6.7 to 9.2 on a VM
running Ubuntu 20.04 (Focal). Although the upgrade to version 9.2 was
completed, pgAdmin still shows version 6.7 when accessed through the
browser. I followed the steps listed below. Could you please advise on what
I might have missed?

-------------
Upgrade Steps:
-------------

sudo apt update
sudo apt list pgadmin4
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo
gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg

optional: sudo sh -c 'echo "deb
[signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg]
https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" >
/etc/apt/sources.list.d/pgadmin4.list'

sudo apt upgrade pgadmin4

dpkg: warning: unable to delete old directory '/var/lib/ubuntu-advantage':
Directory not empty
dpkg: warning: unable to delete old directory '/etc/ubuntu-advantage':
Directory not empty

dpkg: warning: unable to delete old directory '/var/lib/fwupd': Directory
not empty

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

Setting up pgAdmin 4 in web mode on a Debian based platform...
Creating configuration database...
pgAdmin 4 - Application Initialisation
======================================

Creating storage and log directories...
We can now configure the Apache Web server for you. This involves enabling
the wsgi module and configuring the pgAdmin 4 application to mount at
/pgadmin4. Do you wish to continue (y/n)? y
The Apache web server is running and must be restarted for the pgAdmin 4
installation to complete. Continue (y/n)? y
Apache successfully restarted. You can now start using pgAdmin 4 in web
mode at http://127.0.0.1/pgadmin4

Verification:
--------------

apt list --installed | grep pgadmin4

WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.

libpq-dev/pgadmin4,now 17.4-1.pgdg20.04+2 amd64 [installed]
libpq5/pgadmin4,now 17.4-1.pgdg20.04+2 amd64 [installed,automatic]
pgadmin4-desktop/pgadmin4,now 9.2 amd64 [installed,automatic]
pgadmin4-server/pgadmin4,now 9.2 amd64 [installed,automatic]
pgadmin4-web/pgadmin4,now 9.2 all [installed,automatic]
pgadmin4/pgadmin4,now 9.2 all [installed]

On Thu, May 22, 2025 at 2:32 PM zaidagilist <zaidagilist(at)gmail(dot)com> wrote:

> Hello Daulat,
>
> I just ran the pgAdmin4 setup on my Ubuntu VM and followed the steps
> mentioned at this link <https://www.pgadmin.org/download/pgadmin-4-apt/>.
> The installation and setup worked fine on my end. In my environment, Python
> 3.10.12 is installed.
>
> Regards,
> Zaid
>
>
>
>
>
> On Thu, May 15, 2025 at 2:19 PM Daulat <daulat(dot)dba(at)gmail(dot)com> wrote:
>
>> Hello Team,
>>
>> I am currently facing an issue while installing pgAdmin 4 in web mode on
>> an Ubuntu 20.04 (Focal) system.
>>
>> Error:
>>
>> /usr/pgadmin4/venv/bin/python3: can't open file
>> '/usr/pgadmin4/web/setup.py': [Errno 2] No such file or directory
>>
>> ls -l /usr/pgadmin4
>> total 24
>> drwxr-xr-x 4 root root 4096 May 15 09:01 bin
>> -rw-r--r-- 1 root root 11206 Apr 2 10:26 sbom-desktop.json
>> -rw-r--r-- 1 root root 474 Apr 2 10:26 sbom-web.json
>> drwxr-xr-x 6 root root 4096 May 15 08:58 venv
>>
>> Since the pgAdmin installation did not automatically create the required
>> virtual environment, I manually set it up using python3.8 -m venv
>> /usr/pgadmin4/venv, but the setup still fails due to a missing setup.py
>> file in /usr/pgadmin4/web/
>>
>> sudo python3.8 -m venv /usr/pgadmin4/venv
>> source /usr/pgadmin4/venv/bin/activate
>>
>> I followed the following steps from
>> https://www.pgadmin.org/download/pgadmin-4-apt/
>>
>> Please advise.
>>
>> Thanks,
>>
>>
>>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Usman Khan 2025-05-24 13:08:58 Re: Open preferences in new tab
Previous Message Aditya Toshniwal 2025-05-22 11:32:28 Re: Open preferences in new tab

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2025-05-22 13:23:18 Re: Stop sending
Previous Message zaidagilist 2025-05-22 09:08:02 Re: pgAdmin 4 in web mode on an Ubuntu 20.04 (Focal) system.