Skip to content

Instantly share code, notes, and snippets.

@dweldon
Created August 4, 2022 05:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dweldon/cfe080d7cc189df3217dcc1c15ae96db to your computer and use it in GitHub Desktop.
Save dweldon/cfe080d7cc189df3217dcc1c15ae96db to your computer and use it in GitHub Desktop.
Install pgAdmin 4 on Ubuntu without using apt-key (22.04)
#!/bin/sh
# https://askubuntu.com/questions/1286545/
# https://www.pgadmin.org/download/pgadmin-4-apt/
gpg_file="pgadmin4.gpg"
wget https://www.pgadmin.org/static/packages_pgadmin_org.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import packages_pgadmin_org.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output "${gpg_file}"
rm temp-keyring.*
rm packages_pgadmin_org.pub
sudo chown root:root "${gpg_file}"
sudo mv "${gpg_file}" /etc/apt/keyrings/
echo "deb [signed-by=/etc/apt/keyrings/${gpg_file}] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" | sudo tee /etc/apt/sources.list.d/pgadmin4.list
sudo apt-get update
# Choose one of pgadmin4, pgadmin4-desktop, pgadmin4-web
sudo apt-get install -y pgadmin4-desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment