Score:1

Pgadmin4 stop working under 23.04

tl flag

Pgadmin4 does not work after upgrading to version 23.04. Even after reinstalling from the official repository.

ru flag
Given that 23.04 only just released, pgadmin4 might not yet support 23.04 and its libraries, but that's not something Ubuntu or us can necessarily fix. When you say "official repository" do you mean the apt repository or Python/PyPI?
eLDe avatar
tl flag
Apt repository of course
Score:1
vc flag

You have to wait until 7.1 is released, or use one of the snapshot builds at https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/ This may or may not be stable (or may not be there at all if the build failed for some reason).

Score:0
ng flag

I was able to install pgadmin4 on freshly installed ubuntu 23.04 using APT for Kinetic Kundu + several manual steps.

Note: Probably that is not the best approach, probably there are better, but that worked for me :shrugs:

Note2: I did it when pgAdmin 7.0 wasn't released; I used 6.21. But I believe that there should be not much difference (in step 5 it will be psycopg3, not psycopg2).

So, I did the following 5 steps:

  1. Prepare. Install required dependencies. It's important to install them before you add the pgadmin's Kinetic apt list. Otherwise you'll get issues with versions conflicts:
sudo apt install python3-pip python3-full libldap2 libpq5 libpq-dev

2). Add pgadmin's apt for Ubuntu Kinetic, like described here https://www.pgadmin.org/download/pgadmin-4-apt/

# Install the public key for the repository (if not done previously):
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg

# Create the repository configuration file:
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/kinetic pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

Make sure you use 'kinetic' instead of lunar (don't use lsb_release, or replace 'lunar' to 'kinetic' after you added the repo). i.e. check that file:

/etc/apt/sources.list.d/pgadmin4.list

has this line inside:

deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/kinetic pgadmin4 main

Then do the

sudo apt update

# Install for both desktop and web modes:
sudo apt install pgadmin4

# Install for desktop mode only:
sudo apt install pgadmin4-desktop

# Install for web mode only: 
sudo apt install pgadmin4-web 

I proceeded with pgadmin4-desktop.

  1. at this moment you will get pgadmin installed. But it will not work yet, because ubuntu 23.04 comes with python 3.11 installed; pgadmin4 from the apt expects python 3.10.

If you try to start the pgadmin, it will hang for 90 seconds, then you'll get the error message.

To not wait 90 seconds every time, you can use the following command to check / get the error message:

/usr/pgadmin4/venv/bin/python3 -s /usr/pgadmin4/web/pgAdmin4.py
  1. make necessary links using the "ln -s " command. Places to make the links: /usr/bin/python3.11 -> python3.10 and a few links will be required inside /usr/pgadmin4/venv/ (maybe /usr/lib/python3.10 -> python3.11) Unfortunately, I didn't write down exactly what links I made, so I can't give detailed instructions for this step at the moment. Take a look for broken links in these directories, and fix that. I used midnight commander (mc), it highlights broken links with red color. If you are stuck at this step, feel free to ask in the comments. If you managed with that task and have documented the list of the links required, provide it please. I'll update the instructions.

  2. after the python starts to work in the pgadmin virtual env, the pgadmin will try to start, but will raise various errors. You'll need to reinstall a few python modules in the pgadmin venv. Namely:

psycopg2
cffi
psutil
greenlet
brotli

To do that, use the following command:

/usr/pgadmin4/venv/bin/pip3 uninstall <module_name>

then

/usr/pgadmin4/venv/bin/pip3 install <module_name>

Done! You have the pgadmin4 installed and working!

  1. Now click the thumb up and subscribe :) then grab a cup of your favorite drink :)
Willian Cristian avatar
md flag
Sorry, I'm still new to the terminal and I'm not familiar with it and in step 4 onwards I didn't understand how to use the ls -s command and if I have to enter the folders described in step 4.
Score:0
ai flag

I reinstalled pgadmin4-desktop on ubuntu 23.04 using the snapshots repository and it is working without any issues. First I removed the previosly installed pgadmin4:

sudo apt remove pgadmin4

Make sure you have the repository key installed:

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

My pgadmin4.list contains:

deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://apt.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2023-04-27/apt/lunar/ pgadmin4 main

Then install pgadmin4:

sudo apt update && sudo apt install pgadmin4

Update: pgadmin4 is now available from the main repository, no longer necessary to use the snapshot.

deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/lunar pgadmin4 main
eLDe avatar
tl flag
Thanks a lot, it works for me too.
Score:0
in flag

PgAdmin developers seem to believe that the name of the Ubuntu 23.04 release is "bookworm". As a result, the distribution is located at https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm/dists/pgadmin4/

However, the actual name is "lunar". Check this by command

echo $(lsb_release -cs)

To install PgAdmin, follow the standard instructions from https://www.pgadmin.org/download/pgadmin-4-apt/, but make sure to change the command:

sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

to

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

After making this adjustment, PgAdmin should work correctly.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.