Installing PostgreSQL Using RPM Packages
We will be using PostgreSQL RPMs on RHEL to install PostgreSQL without internet access. There are two methods to achieve this. The first option is to visit this link https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-9.4-x86_64/and download each RPM package individually. However, this approach can lead to missing dependencies, You might forget which packages are necessary or overlook certain dependencies. If a required RPM is missing from the provided URL, you’ll have to search the internet to find the correct RPM.The second option is to set up an alternative machine with internet access and use a few yum commands to download the necessary RPMs along with all their dependencies. Once you have downloaded the RPMs, you can upload them to the target host. This method ensures that all required RPMs are included, saving you the hassle of searching for packages online and significantly reducing the time spent on the installation process.On the host with internet
Run yum deplist command to find out all the required packages to install PostgreSQL (Make sure the PGDG repository is already configured on your host)Read more here: https://www.postgresql.org/download/sudo yum deplist postgresql17-serverOnce you get the list then you can run this command to download the packages sudo yum install --downloadonly --downloaddir=postgres-rpms/ postgresql17-serverWhere postgres-rpms is the local directory name on the filesystem where all the required RPMs will be downloaded Once this is done and you have the required list of RPMs go ahead and upload them to the server without internet access and install the RPMs with
sudo rpm -ivsh *.rpmOr run sudo yum localinstall *.rpmThis made the PostgreSQL installation quite straightforward, as it only required an additional 3 or 4 packages. However, in our upcoming blogs, we will explore how to install PostGIS, which has a significantly larger number of dependencies, and discuss effective methods for installing PostGIS without internet access.Frequently Asked Questions (FAQs)
Q.What is the recommended workflow for deploying PostgreSQL in air-gapped RHEL environments?
The most effective strategy involves using a temporary internet-connected staging server running the same OS version as the target. You use this staging machine to resolve and download the specific PostgreSQL RPMs and all dependencies, then securely transfer the complete package set to the offline environment.
Q. How do we ensure complete dependency resolution for offline PostgreSQL installations?
Instead of manually guessing requirements, run sudo yum install –downloadonly –downloaddir=[directory] postgresql17-server on your staging machine. This command utilizes the package manager to identify and download the entire dependency tree, ensuring no required libraries are missing during the final install.
Q. What are the operational risks of manually downloading individual RPMs from the repository?
Downloading packages individually often leads to “dependency hell” where the installation fails due to missing or mismatched shared libraries. The manual approach lacks the automatic resolution logic of the package manager, increasing deployment time and the likelihood of configuration errors.
Q. How can engineers audit the required libraries before initiating the download?
You can execute sudo yum deplist postgresql17-server on the connected staging host. This command outputs a comprehensive list of every dependency and provider package required by the PostgreSQL server, allowing for verification of the software supply chain.
Q.Which command should be used to execute the installation on the disconnected server?
Once the RPMs are transferred to the target host, the best practice is to run sudo yum localinstall *.rpm. This method is preferred over standard RPM commands because it automatically handles the installation order and verifies the integrity of the local package set.




