How to update an offline Red Hat Enterprise Linux server without network connection to Red Hat/Proxy/Satellite?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5, 6, 7, 8 and 9
  • Red Hat (CDN)

Issue

Resolution

Different scenarios of updating an offline system are discussed in How can we regularly update the system without internet connection ?

If none of the methods mentioned in the above article work, you can update an offline system by using a online system to download the RPMs from and copy them over to the offline system.

  1. On the online/connected system: Verify that the required packages are installed for downloading the RPMs:
Install yum-utils for Red Hat Enterprise Linux 7 , yum-plugin-downloadonly for Red Hat Enterprise Linux 6 or yum-downloadonly and yum-utils for Red Hat Enterprise Linux 5 on the machine which is connected to the Internet or any repository:

Note: The repository needs to be enabled on the online system for that system to be able to download the packages, you can verify this with the command # yum repolist

  1. Copy the RPM db from the offline system to the online system (This could also be copied to a USB drive):
# tar --ignore-failed-read -zchpf rpmdb.tgz /var/lib/{rpm,dnf} /etc/{dnf*,os-release}
# scp rpmdb.tgz root@online:/tmp/
  1. Extract the database on the online system into an empty directory
# mkdir /tmp/rpm_db/
# tar xf /tmp/rpmdb.tgz -C /tmp/rpm_db/
  1. On the online system download all the RPM packages and create a repository
# yum update --downloadonly --downloaddir /tmp/rpm_db --installroot=/tmp/rpm_db/
# yum -y install createrepo
# createrepo /tmp/rpm_db
  1. Copy the downloaded rpm updates from the online system to the offline system (This could also be copied to a USB drive)
# cd /tmp/rpm_db
# tar czf /tmp/rpm-updates.tgz *.rpm repodata
# scp /tmp/rpm-updates.tgz root@offline:/tmp/
# ssh root@offline
# mkdir /tmp/rpms
# tar xf /tmp/rpm-updates.tgz -C /tmp/rpms
  1. Update the offline system

Up to RHEL7 included:

# yum localinstall /tmp/rpms/*.rpm

RHEL8 and RHEL9:

# dnf --nogpgcheck --repofrompath OFFLINE,/tmp/rpms update

Root Cause

The system has no network connection or has a very limited network connection and is not able to get updates directly via the network.

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.