11

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

vladislav
  • 133
  • 1
  • 2
  • 8

7 Answers7

27

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
klutt
  • 30,332
  • 17
  • 55
  • 95
ankit raj
  • 271
  • 3
  • 2
10
# 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.

HackerDev-Felix
  • 226
  • 2
  • 5
8

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.

tourniquet_grab
  • 792
  • 9
  • 14
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'
Erik Geletti
  • 84
  • 1
  • 1
  • 6
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
1

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'
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

andres_995
  • 141
  • 1
  • 5