How to update offline RHEL server without network connection to Red Hat Network/Proxy/Satellite.
last modified by Imogen Flood-Murphy on 01/05/12 - 07:45
A Red Hat Enterprise Linux server which is not connected to the Internet, needs to be updated, and has no access to a RHN Satellite or Proxy server.
There is a server which is offline and doesn't have any connection to the Internet.
Then we need station (or laptop / virtual machine), which has the same major Red Hat Enterprise Linux version as server and is connected to the Red Hat Network/Proxy/Satellite.
Copy the /var/lib/rpm to the station connected to the Internet (you can use USB/CD…)
scp -r /var/lib/rpm root@station:/tmp/
Install the download only plugin for yum and createrepo on the machine which is connected to the Internet (Red Hat Network):
yum install yum-downloadonly createrepo yum clean all
Backup the original rpm directory on the station and replace it with the rpm directory from the "offline" server:
mv -v /var/lib/rpm /var/lib/rpm.orig mv -v /tmp/rpm /var/lib/
Download updates to /tmp/rpm_updates and return back the /var/lib/rpm
mkdir -v /tmp/rpm_updates yum update --downloadonly --downloaddir /tmp/rpm_updates createrepo /tmp/rpm_updates rm -rvf /var/lib/rpm mv -v /var/lib/rpm.orig /var/lib/rpm
Transfer the downloaded rpms to the server and update:
scp -r /tmp/rpm_updates root@server:/tmp/ ssh root@server cat > /etc/yum.repos.d/rhel-offline-updates.repo << \EOF [rhel-offline-updates] name=Red Hat Enterprise Linux $releasever - $basearch - Offline Updates Repository baseurl=file:///tmp/rpm_updates enabled=1 EOF yum upgrade
…and the server is updated.
These updates are the same as if "yum update" had been executed on a station that had a connection to the Internet.