Can't install pgadmin4 repository does not have file
Asked Answered
J

9

16

I was use command

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'

But I was got this

Err:2 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release                               
  404  Not Found [IP: 87.238.57.227 443]
Hit:3 https://community-packages.deepin.com/printer eagle InRelease                                          
Hit:4 https://home-store-img.uniontech.com/appstore deepin InRelease                                         
Reading package lists... Done
E: The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

So I can't install pgadmin

Use Deepin linux 20.2.3

Jumbo answered 14/9, 2021 at 23:13 Comment(1)
You can use DBeaver Community and choose Postgres when creating connection, it's much easier than solve a lot of problems with pgadminSymptomatology
T
11
# apt-get install curl ca-certificates gnupg
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#vim /etc/apt/sources.list.d/pgdg.list
 ####### ADD
#deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main

# apt-get update
# apt-get install pgadmin4  pgadmin4-apache2

It should now be successfully installed.

Tufthunter answered 15/9, 2021 at 1:45 Comment(1)
Can you explain what was wrong in OP command? That will make your answer more valueable.Kidder
S
36

I am using Linux mint, issue has been fixed using the below command.

$ 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/apt/focal pgadmin4 main" \
  > /etc/apt/sources.list.d/pgadmin4.list && apt update'
$ sudo apt update

And then, if you want desktop

$ sudo apt install pgadmin4-desktop

OR the web version:

$ sudo apt install pgadmin4-web 
$ sudo /usr/pgadmin4/bin/setup-web.sh
Soke answered 20/2, 2022 at 20:10 Comment(1)
Thank you! But why is the necessary after following Postgres own instructions?Kellogg
H
17

For Ubuntu 22.10 and other versions that complain about apt-key being deprecated, use this:

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

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

Note that "jammy" is being used here in the ftp link. You may browse through the other versions and pick the one that matches your Ubuntu installation's version

sudo apt install pgadmin4

This installs both web and desktop versions.

Holub answered 13/11, 2022 at 3:24 Comment(1)
This imo should be marked as the correct answer as it takes into account the current deprecation of apt-key.Sloganeer
T
11
# apt-get install curl ca-certificates gnupg
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#vim /etc/apt/sources.list.d/pgdg.list
 ####### ADD
#deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main

# apt-get update
# apt-get install pgadmin4  pgadmin4-apache2

It should now be successfully installed.

Tufthunter answered 15/9, 2021 at 1:45 Comment(1)
Can you explain what was wrong in OP command? That will make your answer more valueable.Kidder
T
3

The problem is that lsb_release -cs is not returning the codename for Deepin linux, instead is returning n/a. Try with that dpkg --status tzdata|grep Provides|cut -f2 -d'-' to retrive the codename.

If you want a oneliner like the one you posted, here you have:

sudo sh -c 'curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add && echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(dpkg --status tzdata|grep Provides|cut -f2 -d'-') pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Transponder answered 20/9, 2021 at 13:36 Comment(1)
Still the same error...Kyrakyriako
A
2

I was facing the same challenge on my Kali GNU/Linux Rolling and I manage to fix it by changing the $(lsb_release -cs) to bookworm and boom, was able to install and run the pgAdmin4 without getting error Unable to connect to pgadmin4 server

so for Kali GNU/Linux Rolling users, just follow the procedure on the pgAdmin4 page, or click on this link to take you there https://www.pgadmin.org/download/pgadmin-4-apt/, and if you reach the second command just change the $(lsb_release -cs) to bookworm and continue with the rest

sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Abernethy answered 9/7, 2023 at 12:51 Comment(1)
If the ubuntu version Is not available then, use the Debian version. this should be in official documentation. I am on ubuntu 24.04 and Postgres is yet not available for the same. this worked for me.Hetti
W
1

I experienced this error trying to upgrade my pgadmin4 to version 6. There was a problem with the certificates on my system I think, the solution was updating ca-certificates, if it's not installed you should probably install it, but that may be very unlikely that it's not installed though as it should already be there, but either way just run the command:

sudo apt install ca-certificates
Wornout answered 4/4, 2022 at 8:19 Comment(2)
Not working in Linux MintKilkenny
Have you added the most current Postgres repository to your system, if you haven't then you should do that before attempting to install ca-certificatesWornout
N
1

This worked for me: from the steps as stated from the official website replace the this code with its equivalent from the steps

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

After that follow the usual installation process as stated

The local server might not appear on the Servers dropdown from pgadmin so following the step from this video will sort that out https://www.youtube.com/watch?v=jhG2L4OWRY8

Neil answered 6/4 at 16:34 Comment(0)
M
0

I had the same problem with Debian 11, however exploring options I found this answer enter link description here and fixed the problem by installing lsb-release

Maintenance answered 1/7, 2022 at 17:8 Comment(0)
S
0

Another solution is to not use pgadmin4 at all. There are other DB clients, integrated in IDE or not. After spent a lot of time to install pgadmin4 on new Ubuntu (https://github.com/pgadmin-org/pgadmin4/issues/7437) I just figured out that it's much easier to use DBeaver (github: https://github.com/dbeaver/dbeaver, site: https://dbeaver.io/download) enter image description here

Symptomatology answered 11/5 at 10:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.