Authors: Israel Barth and Prince Nwando.
This article takes a look at how we can install RPM and DEB packages in a server that is not connected to the Internet.
One way of doing that is described in the knowledge base article How to proxy our private Yum and Apt repositories, which consists of using a proxy for the repositories. It works both for RPM and DEB based installations.
Another way is described in the present article, which also works with RHEL based RPM
as well as a Debian based DEB
platforms. It consists of downloading the packages and its dependencies through RPM/DEB repository on a server with Internet access, and then copying the RPM / DEB packages to the server without Internet and lastly performing a local installation.
EDB currently has two independent repository systems:
- EDB Repos 2.0 is the latest, recommended system.
- EDB Repos 1.0 is the legacy system.
Please note that the EDB Repos 1.0 will be dismissed in the near future, therefore, unless you have any special reasons to use it, we recommend using EDB Repos 2.0, which is our more advanced repository system.
As an example in this article, we will demonstrate installing PostgreSQL 15 on a Rockylinux 8 and Ubuntu 22.04 servers using both repository systems.
- Navigate to https://www.enterprisedb.com/repos-downloads and click on "Access EDB Repos 2.0"
- Select Platform
- Click on the desired product
- Run the commands as demonstrated below to set up the repository in your server that is connected to the Internet.
Within EDB Repos 2.0, there are two options for installation. Choose one of them:
- Auto
- Manual
# Install yum-utils
dnf install -y yum-utils
# Run repo setup autocommand
# **your_company_token** will already be filled up for you (NOTE: never share the token in Support tickets or via email)
curl -1sLf 'https://downloads.enterprisedb.com/**your_company_token**/enterprise/setup.rpm.sh' | sudo -E bash
# Disable the built-in PostgreSQL module:
dnf -qy module disable postgresql
curl -1sLf 'https://downloads.enterprisedb.com/**<your_company_token>**/enterprise/setup.deb.sh' | sudo -E bash
# Install yum-utils
dnf install -y yum-utils
# Import key
rpm --import 'https://downloads.enterprisedb.com/**your_company_token**/enterprise/gpg.E71EB0829F1EF813.key'
# Import config
curl -1sLf 'https://downloads.enterprisedb.com/**your_company_token**/enterprise/config.rpm.txt?distro=el&codename=8' > /tmp/enterprise.repo
# Add config
dnf config-manager --add-repo '/tmp/enterprise.repo'
# Enable repo
dnf -q makecache -y --disablerepo='*' --enablerepo='enterprisedb-enterprise'
# Disable the built-in PostgreSQL module:
dnf -qy module disable postgresql
apt-get install -y debian-keyring # debian only
apt-get install -y debian-archive-keyring # debian only
apt-get install -y apt-transport-https
# For Debian Stretch, Ubuntu 16.04 and later
keyring_location=/usr/share/keyrings/enterprisedb-enterprise-archive-keyring.gpg
curl -1sLf 'https://downloads.enterprisedb.com/**your_company_token**/enterprise/gpg.E71EB0829F1EF813.key' | gpg --dearmor > ${keyring_location}
curl -1sLf 'https://downloads.enterprisedb.com/**your_company_token**/enterprise/config.deb.txt?distro=ubuntu&codename=<your_ubuntu_flavor>' > /etc/apt/sources.list.d/enterprisedb-enterprise.list
apt-get update
- Navigate to https://www.enterprisedb.com/repos-downloads
- Take note of your Repo Username/Password shown in the EDB Repos 1.0 section. These credentials are different than the ones you used to login to the website
- Click "Access EDB Repos 1.0"
- Select Platform
- Click on the desired product
- Run the commands as demonstrated below to set up the repository in your Internet connected server
# Install yum-utils
dnf install -y yum-utils
# Install the repository configuration
dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
# Replace 'USERNAME:PASSWORD' below with the Repo username and password you annotated previously
# Go back to https://www.enterprisedb.com/repos-downloads in case you need to get them
sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
# Install EPEL repo
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# Disable the built-in PostgreSQL module:
dnf -qy module disable postgresql
# Setup the EDB repository
sudo su -c 'echo "deb [arch=amd64] https://apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/edb-$(lsb_release -cs).list'
# Replace '<USERNAME>' and '<PASSWORD>' below with your username and password for the EDB repositories.
# Visit https://www.enterprisedb.com/accounts/profile to get your username and password
sudo su -c 'echo "machine apt.enterprisedb.com login <USERNAME> password <PASSWORD>" > /etc/apt/auth.conf.d/edb.conf'
# Add support for secure APT repositories
sudo apt-get -y install apt-transport-https
# Add the EDB signing key
sudo wget -q -O - https://apt.enterprisedb.com/edb-deb.gpg.key | sudo apt-key add -
# Update the repository meta data
sudo apt update
Still in the server with Internet connection, create a directory to receive all RPM / DEB files and enter (cd
) into that directory. As an example, we will host all downloaded RPM / DEB files under a folder called edb_packages
:
mkdir edb_packages && cd edb_packages
On the Internet connected server, run yumdownloader to download the package you want. The --resolve option will also resolve and download all dependencies:
yumdownloader -y postgresql15-server postgresql15-contrib --resolve
dnf download postgresql15-server postgresql15-contrib --resolve --alldeps
sudo apt-get --download-only -o Dir::Cache=$(pwd) install postgresql-15
At this point the folder edb_packages
will contain all the required packages and their dependencies. Confirm that the files are present with ls -l
, for example, on RHEL 8:
-rw-r--r-- 1 root root 9258864 Apr 24 13:13 libicu-60.3-2.el8_1.x86_64.rpm
-rw-r--r-- 1 root root 254484 Apr 24 13:13 libxslt-1.1.32-6.el8.x86_64.rpm
-rw-r--r-- 1 root root 104920 Apr 24 13:13 lz4-1.8.3-3.el8_4.x86_64.rpm
-rw-r--r-- 1 root root 29776 Apr 24 13:12 perl-Carp-1.42-396.el8.noarch.rpm...
...
...
...
-rw-r--r-- 1 root root 1703300 Apr 24 13:03 postgresql15-15.2-1PGDG.rhel8.x86_64.rpm
-rw-r--r-- 1 root root 767956 Apr 24 13:03 postgresql15-contrib-15.2-1PGDG.rhel8.x86_64.rpm
-rw-r--r-- 1 root root 299780 Apr 24 13:03 postgresql15-libs-15.2-1PGDG.rhel8.x86_64.rpm
-rw-r--r-- 1 root root 6200624 Apr 24 13:03 postgresql15-server-15.2-1PGDG.rhel8.x86_64.rpm
Now you can copy the above folder containing all RPM / DEB files to your isolated Internet-less server.
Enter (cd
) into the directory containing the RPM / DEB files in the Internet-less server and install the packages with one of the following commands.
dnf --disablerepo=* localinstall *.rpm
apt install -y *.deb
You can check the installed package with the following commands.
dnf list installed postgresql15-server
Example output:
Installed Packages
postgresql15-server.x86_64 15.2-1PGDG.rhel8 @@commandline
sudo apt list postgresql-15 -a
Listing... Done
postgresql-15/jammy,now 15.7-1EDB.jammy amd64 [installed]
postgresql-15/jammy 15.6-2EDB.jammy amd64
postgresql-15/jammy 15.6-1EDB.jammy amd64
postgresql-15/jammy 15.5-1EDB.jammy amd64
postgresql-15/jammy 15.4-1.jammy amd64
postgresql-15/jammy 15.3-1.jammy amd64
postgresql-15/jammy 15.2-1.pgdg22.04+1 amd64