6

I'm running Linux Mint 19 Tara, and trying to follow the instructions here with the goal of installing pgAdmin4 as a desktop app. There seems to be a problem involving the authentication of the repository.

The apt-key step seems to work, as I observe PostgreSQL Debian Repository in the apt-key list.

I don't have a deb command (I imagine this is a Mint vs Ubuntu difference?), so I used
add-apt-repository http://apt.postgresql.org/pub/repos/apt/ tara-pgdg main
instead, after which I observe
deb http://apt.postgresql.org/pub/repos/apt/ bionic main
in /etc/apt/sources.list.d/additional-repositories.list.

At this point running either apt-get upgrade or apt-get update shows an error
The repository 'http://apt.postgresql.org/pub/repos/apt bionic Release' does not have a Release file.

How can I proceed? It seems unlikely that there really isn't a release file; I can see what looks like an authentication list at https://apt.postgresql.org/pub/repos/apt/dists/bionic-pgdg/. Do I have a path wrong or something?

ShapeOfMatter
  • 181
  • 1
  • 1
  • 6
  • Queued by @sabbir-ahmed's answer, I see that the problem was that `tara-pgdg` in the `add-apt-repository` command was getting mapped to or replaced by `bionic`; it should have been `bionic-pgdg`. – ShapeOfMatter Sep 09 '18 at 22:58

3 Answers3

10
  1. Open terminal and type:

     wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    
  2. Open Software Sources and click on "Additional repositories" and paste the following for Linux Mint 19 (it's based on Ubuntu Bionic):

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

    or the following for Linux Mint 20 (based on Ubuntu Focal Fossa):

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

it should look like this: enter image description here

Press "OK" and that will automatically update cache.

  1. Now open terminal and type the following:

     sudo apt update
     sudo apt install pgadmin4
    

That should install pgadmin4.

Possible
  • 3
  • 2
Sabbir Ahmed
  • 116
  • 1
  • 5
  • 2
    I get `malformed input, repository not added` when I do this on Mint 19.1. Instead, I followed [these instructions](https://wiki.postgresql.org/wiki/Apt) inserting `bionic` to replace `stretch` in the example given. – LondonRob May 13 '19 at 13:04
  • https://wiki.postgresql.org/wiki/Apt Use URL for repo from here.. – Sandeep Dhull May 15 '19 at 20:00
  • for mint 18 I had to use xenial instead of bionic – Jose Cabrera Zuniga Aug 29 '19 at 16:51
  • Would this work on Linux mint 20? – Arya Jul 26 '20 at 21:17
  • A word of caution: I copied the repository URL from this post. However, by accident the copied string included a leading whitespace. When that happens, the Software Sources will complain about the "malformed URL". Be sure to copy the string *exactly*. – Martin Häusler Sep 25 '20 at 08:46
  • didnt work for me on linux mint 19. got error `malformed input` when using `deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main` – jtlindsey Dec 02 '20 at 16:27
5

The following worked for me in Linux Mint 19.1 modified from docs because my machine had $(lsb_release -cs) returning tessa which was not working but bionic was working.

Setup the repository

Install the public key for the repository (if not done previously):

curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add

Create the repository configuration file:

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

Install pgAdmin

Install for both desktop and web modes:

sudo apt install pgadmin4

jtlindsey
  • 333
  • 2
  • 5
  • 14
1

Python approach always work

$ sudo mkdir /var/lib/pgadmin
$ sudo mkdir /var/log/pgadmin
$ sudo chown $USER /var/lib/pgadmin
$ sudo chown $USER /var/log/pgadmin
$ python3 -m venv pgadmin4
$ source pgadmin4/bin/activate
(pgadmin4) $ pip install pgadmin4

(pgadmin4) $ pgadmin4

or

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 install pgadmin4
Yilmaz
  • 289
  • 1
  • 4
  • 22
  • Thanks. I used the second set of instructions and finally got pgadmin4 installed on my computer. – njs May 04 '22 at 03:28