Walker News

How To Perform In-place Upgrade For Red Hat Enterprise Linux?

Question: Is it possible to upgrade Red Hat Enterprise Linux on-the-fly without having to reinstall the Linux OS from scratch again?

Answer: Yes, it’s possible for a same major release upgrade from lower to higher update number, e.g. upgrade from RHEL5.7 to RHEL5.9.
I’ve done a number of in-place upgrade for both staging and production systems without any problem. You should, however, perform a system backup prior to execute this in-place upgrade plan and please do it at your own risk when applying this type of upgrade on production system!

Here is the procedure I used to upgrade RHEL5.7 to RHEL5.9, which is pretty simple and fast:

1. Mount the latest RHEL update DVD or ISO file to /media directory. E.g.

Mount DVD in /dev/cdrom device:
mount -t iso9660 /dev/cdrom /media

Mount ISO image saved in /root directory:
mount -o loop -t iso9660 /root/rhel59.iso /media

2. Make sure YUM is able to use the mounted DVD as repository. By default, RHEL installation doesn’t create the DVD repository. To create one is simple as this:

Uses vi to create the repo file:
vi /etc/yum.repos.d/rhdvd.repo

Paste these lines into rhdvd.repo file:

3. [ Optional, but recommended ] Login to system console (not pseudo console, e.g. the ssh/putty console) as root and run telinit 1, which will switch Linux to single user mode.
Single user mode means no network access and only allows one login session to Linux system at any one time. This step ensures that no other user can login and work in the system, which may cause the upgrade to fail (due to file locking).

4. Now it’s the show time – run this command to upgrade RHEL on-the-fly:
yum --enablerepo=rhdvd update -y | tee /tmp/yum.update.log

Once the yum update completes, check the yum.update.log for error (no means good sign). During the update, some of the edited system/application configuration files are preserved and the new default config file is renamed to end with .rpmnew file extension (which means sysadmin have to manually migrate the settings from old to new config file, if it’s applicable).

Custom Search

2017  •  Privacy Policy