6

I've already installed postgres, okay. But I'm trying to install pgadmin4 for about 2 hours and I just cannot. I tried a lot of guides on the Internet and they just get to the same result:

Package 'pgadmin4' has no installation candidate

I'm using this repo:

deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main

output:

Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'

So, I have to put [arch=amd64], right? It should look like this? deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main

OKay, the i386 error doesn't show up at apt update. But then I try to apt install pgadmin4 and

sudo apt install pgadmin4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package pgadmin4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'pgadmin4' has no installation candidate***

It looks like a joke, how can I solve this situation?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
  • See here [Dropped](https://www.postgresql.org/message-id/X/HFYQ8bdllo27PI%40msg.df7cb.de). So [pgAdmin repo](https://www.pgadmin.org/download/pgadmin-4-apt/) – Adrian Klaver Aug 13 '21 at 20:20
  • I've had tried this one. The output is the same ' The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/uma pgadmin4 Release' does not have a Release file. ' – Vilson Rodrigues Junior Aug 13 '21 at 20:47
  • 1
    The issue is this: `.../apt/uma` which comes from `...$(lsb_release -cs)...` in '# Create the repository configuration file:' Replace `$(lsb_release -cs)` with `focal` as that is the Ubuntu release Mint 20 is based on and the pgAdmin repos don't have Mint named releases. FYI, if you have choice stick with Ubuntu distros it will make your life easier. – Adrian Klaver Aug 13 '21 at 20:57
  • As I said above, I tried this one too " deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main ". It keeps not working, I'm really thinking about leave Mint and install Ubuntu :( – Vilson Rodrigues Junior Aug 13 '21 at 21:08
  • You are not paying attention. The instructions from [pgAdmin repo](https://www.pgadmin.org/download/pgadmin-4-apt/) are pointing you at a different repo. When you go to that page modify the script under '# Create the repository configuration file:' as I showed you in my previous comment. I tried it on my machine and it works. – Adrian Klaver Aug 13 '21 at 21:15
  • It worked now, sorry for not paying attention and doing it wrong. Thanks for helping me! – Vilson Rodrigues Junior Aug 13 '21 at 21:29

2 Answers2

28

To make it clearer. From this page:

https://www.pgadmin.org/download/pgadmin-4-apt/

there are instructions on how to set up the Apt repo. See my modified version below:

#
# Setup the repository
#

# Install the public key for the repository (if not done previously):
sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add

# Create the repository configuration file:
# SEE MODIFICATION BELOW
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'

#
# Install pgAdmin
#

# 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 

# Configure the webserver, if you installed pgadmin4-web:
sudo /usr/pgadmin4/bin/setup-web.sh
Adrian Klaver
  • 15,886
  • 2
  • 17
  • 28
  • Hello, I need to upgrade libgssapi-krb5-2 for 1.7 version. The problem is when I try to upgrade this package it says that libgssapi-krb5-2 is already the newest version (1.16-2ubuntu0.2). How can I solve this? – Andre Mar 10 '22 at 15:33
  • That is a new question that needs more information. Start a new question that specifies: 1) Why you need to upgrade libgssapi-krb5-2? 2) What your OS version is? – Adrian Klaver Mar 10 '22 at 16:39
  • I created the question https://stackoverflow.com/questions/71428489/linux-mint-19-1-cant-upgrade-libgssapi-krb5-2-which-makes-it-impossible-to-inst . I need to upgrade it to complete the instalation of pgAdmin4 – Andre Mar 10 '22 at 17:39
  • The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 Release' does not have a Release file. – Grogu Jan 09 '23 at 22:41
  • 1
    @Grogu. I just tried it and it worked. Did you do the full line: `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'`? – Adrian Klaver Jan 09 '23 at 23:06
  • @AdrianKlaver : Yes and I'm following my own tutorial https://stackoverflow.com/questions/53267642/create-new-local-server-in-pgadmin/66489652#66489652 and I ran into the issue so I began to look for solutions. So far none seems to work. I have opened a new issue on Git https://github.com/pgadmin-org/pgadmin4/issues/5722. It seems to be a problem not only me is facing – Grogu Jan 09 '23 at 23:30
  • You did the 'Install the public key for the repository ...' step? – Adrian Klaver Jan 09 '23 at 23:46
  • @AdrianKlaver : yes. found the solution here https://askubuntu.com/questions/1095266/apt-get-update-failed-because-certificate-verification-failed-because-handshake. It was a certificate issue. Thanks – Grogu Jan 10 '23 at 00:15
0

As at 2021/10/08, I found the new package location possibly has been changed to:
https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal/dists/pgadmin4/main/

Download pgadmin4-server and pgadmin4-desktop, then you should be good to go

PhilipWong
  • 39
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Tyler2P Oct 07 '21 at 17:16