pgAdmin4 on Ubuntu
Installing pgAdmin4 is qualified by the pgAdmin4 (APT) web page, which relies on the curl utility. Ubuntu doesn’t install curl by default, so you need to install it before you can download and install pgAdmin4:
- Download and install curl utility
sudo apt-get install -y curl
Display detailed console log →
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: curl 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Need to get 194 kB of archives. After this operation, 454 kB of additional disk space will be used. Ign:1 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 curl amd64 7.81.0-1ubuntu1.14 Err:1 http://security.ubuntu.com/ubuntu jammy-updates/main amd64 curl amd64 7.81.0-1ubuntu1.14 404 Not Found [IP: 91.189.91.38 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.81.0-1ubuntu1.14_amd64.deb 404 Not Found [IP: 91.189.91.38 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? student@student-virtual-machine:~$ sudo apt-get update Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB] Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Get:4 https://dl.google.com/linux/chrome/deb stable InRelease [1,825 B] Get:5 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB] Get:6 http://security.ubuntu.com/ubuntu jammy-security/main i386 Packages [376 kB] Get:7 https://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,081 B] Get:8 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,244 kB] Get:9 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1,016 kB] Get:10 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [195 kB] Get:11 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1,179 kB] Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe i386 Packages [577 kB] Get:13 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [815 kB] Get:14 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [152 kB] Get:15 http://us.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [543 kB] Get:16 http://us.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [257 kB] Get:17 http://us.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1,226 kB] Get:18 http://us.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [199 kB] Get:19 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [675 kB] Get:20 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,018 kB] Get:21 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [226 kB] Get:22 http://us.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [27.8 kB] Get:23 http://us.archive.ubuntu.com/ubuntu jammy-backports/universe i386 Packages [16.8 kB] Fetched 10.1 MB in 26s (386 kB/s) Reading package lists... Done
- Download and install the public key for the repository (if not done previously):
sudo curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
It may find an existing key and require you to confirm its replacement:
File '/usr/share/keyrings/packages-pgadmin-org.gpg' exists. Overwrite? (y/N) y
- Create the repository configuration file:
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Display detailed console log →
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease Get:6 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 InRelease [4,217 B] Get:7 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4/main all Packages [4,637 B] Get:8 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4/main amd64 Packages [7,693 B] Fetched 16.5 kB in 2s (7,404 B/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 21 packages can be upgraded. Run 'apt list --upgradable' to see them. student@student-virtual-machine:~$ sudo apt-get update Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu jammy InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease Hit:5 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:6 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 InRelease Reading package lists... Done
- Install the pgadmin4 Desktop:
sudo apt install pgadmin4-desktop
Display detailed console log →
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: pgadmin4-server The following NEW packages will be installed: pgadmin4-desktop pgadmin4-server 0 upgraded, 2 newly installed, 0 to remove and 21 not upgraded. Need to get 203 MB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4/main amd64 pgadmin4-server amd64 8.0 [93.5 MB] Get:2 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4/main amd64 pgadmin4-desktop amd64 8.0 [110 MB] Fetched 203 MB in 49s (4,163 kB/s) Selecting previously unselected package pgadmin4-server. (Reading database ... 204519 files and directories currently installed.) Preparing to unpack .../pgadmin4-server_8.0_amd64.deb ... Unpacking pgadmin4-server (8.0) ... Selecting previously unselected package pgadmin4-desktop. Preparing to unpack .../pgadmin4-desktop_8.0_amd64.deb ... Unpacking pgadmin4-desktop (8.0) ... Setting up pgadmin4-server (8.0) ... Setting up pgadmin4-desktop (8.0) ... Processing triggers for desktop-file-utils (0.26-1ubuntu3) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu3) ... Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
- You can launch your pgadmin4 program file or by clicking the pgAdmin4 icon in the other applications menu:
- It takes a couple moments to launch the pgadmin4 desktop. The initial screen will look like:
- After pgadmin4 launches, you’re prompted for a master password. Enter the password and click the OK button to proceed or simply let it sit for a couple minutes to avoid entering a password.
- After entering the password or skipping its entry you arrive at the base dialog, as shown.
- Click the Add New Server link, which prompts you to register your database. Enter videodb in the Name field and click the Connection tab to the right of the General tab.
- In the Connection dialog, enter the following values:
- Host name/address: localhost
- Port: 5432
- Maintenance database: postgres
- Username: student
- Password: student
Enter a name for your database. In this example, videodb is the Server Name. Click the Save button to proceed.
- Having completed the configuration, you now see the home page.
This completes the instructions for installing, configuring, and using PostgreSQL on AlmaLinux. As always, I hope it helps those looking for instructions.