Sunday, April 18

 

RHEL 7.3 to 7.6 Offline Upgrade

For servers that are disconnected from the Internet or Red Hat Network, using the yum update command with the Red Hat Enterprise Linux installation ISO image is an easy and quick way to upgrade systems to the latest minor version. The following steps illustrate the upgrading process:

 

1.    Create a target directory to mount your ISO image. 

     # mkdir /media/rhel76

 2.    Mount the Red Hat Enterprise Linux 5 installation ISO image to the previously created target directory.

# mount -o loop rhel-server-7.6-x86_64-dvd.iso /media/rhel76/

 3.    Check the numeric value found on the first line of the .discinfo file from the mount directory:

# head -n1 /media/rhel76/.discinfo

      [root@test1 yum.repos.d]# head -n1 /media/rhel76/.discinfo

1539194970.388895

[root@test1 yum.repos.d]#

 4.    Create a new file in the /etc/yum.repos.d/ directory, named for instance new.repo, and add content in the following form.

Note: Configuration files in this directory must have the .repo extension to function properly.

      [root@test1 yum.repos.d]# vi rhel76.repo

[rhel76-Server]

mediaid=1539194970.388895

name=RHEL76-Server

baseurl=file:///media/rhel76/Server

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

enabled=1

gpgcheck=1

 

[root@test1 ~]# cd /etc/yum.repos.d/

[root@test1 yum.repos.d]# ls -ltr

total 8

-rw-r--r--. 1 root root 358 Apr  5 20:54 redhat.repo

-rw-r--r--. 1 root root 173 Apr  5 21:05 rhel76.repo

[root@test1 yum.repos.d]# pwd

/etc/yum.repos.d

[root@test1 yum.repos.d]# cat rhel76.repo

[rhel76-Server]

mediaid=1539194970.388895

name=RHEL76-Server

baseurl=file:///media/rhel76/

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

enabled=1

gpgcheck=1

[root@test1 yum.repos.d]#

 

5.    Update all yum repositories including /etc/yum.repos.d/new.repo created in previous steps. As root, type:

[root@test1 yum.repos.d]# yum repolist

Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

repo id                        repo name                             status

rhel76-Server                  RHEL76server                           5,152          

repolist: 5,152

[root@test1 yum.repos.d]#

 

[root@test1 yum.repos.d]# yum list

[root@test1 yum.repos.d]# yum update

 

6.    Reboot and verify the release level.

[root@test1 yum.repos.d]# cat /etc/*release |grep release

Red Hat Enterprise Linux Server release 7.6 (Maipo)

Red Hat Enterprise Linux Server release 7.6 (Maipo)

[root@test1 yum.repos.d]#

 

[root@test1 yum.repos.d]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.6 (Maipo)

[root@test1 yum.repos.d]#

 

Done..