Search code examples
pgadminlinux-mint

Linux Mint 20.x Ubuntu-based / Can't install pgadmin4


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?


Solution

  • (updated to 2023 ubuntu-22.04LTS) 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/jammy 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