Can't install pgadmin4 repository does not have file

Viewed 9035

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

5 Answers

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
# 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.

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'

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

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

Related