LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Articles > Technical
User Name
Password

Notices


By iamswift at 2012-07-31 02:56
Manual upgrade from RHEL 5.5 to RHEL 6.2

Recently I contacted RH for in-place upgrade from RHEL 5 to RHEL 6 and got the standard reply from RH that this kind of upgrade is not supported.
I pressed for any document that gives steps carried out when the “upgradeall” option is selected while upgrading from RHEL 5 to RHEL 6 but got the same reply, saying in-place upgrade is not supported across major releases.
Below is the list of steps I followed to get in-place upgrade from RHEL 5.5 to RHEL 6.2.

Warning: The packages I installed in RHEL 5.5 and RHEL 6.2 is minimal set (say some 650+ packages) and the below steps correspond to upgrade from minimal set RHEL 5.5 to RHEL 6.2. While the below steps should be sufficient to make upgraded RHEL 6.2 to up and running, there might be other rpm upgrades which might fail. The installation logs can be looked into to rectify them on case to case basis.


1. RPM magic number difference
Problem:
The first and foremost hurdle is the rpm support. The magic number used in RHEL 5 is changed in RHEL 6. This means the existing rpm utility installed in RHEL 5.5 cannot be used to install any of the RHEL 6.2 package. If you try to install, following error is thrown:
Code:
/media/Packages # rpm -U --nodeps zip-3.0-1.el6.x86_64.rpm
warning: zip-3.0-1.el6.x86_64.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID fd431d51
error: unpacking of archive failed: cpio: Bad magic
/media/Packages #
Solution:
We need ‘rpm’ and related packages of RHEL 6.2 to be installed in the RHEL 5.5 first and then use it to install all other packages of RHEL 6.2.
Following are the RHEL 6.2 packages which need to be installed/copied manually in RHEL 5.5 to proceed further:
• rpm-*
• popt
• glibc-*
• libcap
• db4
• xz-libs
• lua

Extract the above packages from RHEL 6.2 repository or DVD using below command:
Code:
mkdir rpm_6.2/
cd rpm_6.2/
rpm2cpio /path/to/<pkg>.rpm | cpio –idmv
tar zcvf ../rpm_for_6.2.tar.gz  *			;# Notice tar file created in parent dir
The tar ball has all the RHEL 6.2 rpms required to install the other RHEL 6.2 RPMs.

Copy the created tar file in RHEL 5.5 machine and extract it from “/”.

Code:
cd  /
tar  xvf  /path/to/rpm_for_6.2.tar.gz
There is one other small step required to make the rpm work. The old libpopt libraries are still referred to by the new rpm binary as the /usr/lib64 path is precedent over /lib64/ dir. The old libraries are no longer required and can just be removed.

Code:
cd /usr/lib64/
ls –l libpopt.so*
rm –f libpopt.so*
Check the rpm version

Code:
/home # rpm –version
RPM version 4.8.0
/home #
Now we have rpm package of RHEL 6.2 in place of older 4.4.x version of rpm package of RHEL 5.5.

2. Getting Installation order list and installing packages

Traverse to dir where the RHEL 6.2 packages are available and execute below command to get the order of rpm packages

Code:
rpm –Uvv *.rpm 2>&1 | tee pkg_order.log
The command would read all the packages and provide us the order in which the packages are to be installed (In log file pkg_order.log). Extract the package names and write it in a separate file, say, order_file.txt

The upgrade is triggered by installing RHEL 6.2 rpm packages one-by-one in the same order as given out by previous step.

Code:
cd /path/to/rh6.2pkgs/
for Pkg in $(cat order_file.txt)
do
    rpm –Uvv  --force  --nodeps  $Pkg  2>&1 | tee –a install_logs.log
done
3. Kernel upgrade and creation of initramfs

Problem:
While installing kernel package, the creation of initramfs fails. The installation of kernel package itself will be successful but the scriptlet results in error and thereby failing to create the initramfs under /boot. The failure happens because of the segfault while executing /bin/mktemp.

Code:
+ NEWKERNARGS=
+ grep -q crashkernel
+ '[' 1 -ne 0 ']'
+ NEWKERNARGS=--kernel-args=crashkernel=auto
+ /sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update 2.6.32-220.el6.x86_64 --kernel-args=crashkernel=auto
mktemp[12333]: segfault   rsp: 0000xxxxxxx xxxxxxxx x  xxxxxxxxxxxx
chmod: cannot access `': No such file or directory
usage: plymouth [ --verbose | -v ] { --targetdir | -t } <initrd_directory>
cp: `/etc/ld.so.conf' and `/etc/ld.so.conf' are the same file
cp: `/etc/ld.so.conf.d' and `/etc/ld.so.conf.d' are the same file

gzip: stdout: No space left on device
E: dracut: creation of /boot/initramfs-2.6.32-220.el6.x86_64.img failed
mkinitrd failed
+ exit 1
D: (null): waitpid(8650) rc 8650 status 100 secs 127.394
warning: %posttrans(kernel-2.6.32-220.el6.x86_64) scriptlet failed, exit status 1
Solution:
Obviously something is wrong with the mktemp. The kernel that is loaded in memory is that of RHEL 5.5 (2.6.18-x) and it expects mktemp version corresponding to RHEL 5.5 whereas the currently installed mktemp is version 8.x which is installed from coreutils package of RHEL 6.2.

Extract mktemp-xxx.rpm package of RHEL 5.5 to get mktemp binary. While the kernel package is upgraded, the mktemp of RHEL 5.5 should be available in /bin/ so that the mktemp does not crask and scriptlet succeeds in creating the initramfs for RHEL 6.2.

Code:
cd  /home/mktemp_5.5/
rpm2cpio  /path/to/mktemp-xxx.x86_64.rpm  |  cpio  -idmv
mv   /bin/mktemp   /bin/mktemp_6.2
cp –p /home/mktemp_5.5/mktemp    /bin/
Once the kernel package is installed successfully, the mktemp binaries are to be swapped back to have the correct mktemp version that corresponds to RHEL 6.2

Code:
mv  /bin/mktemp_6.2   /bin/mktemp
Once complete, reboot the system and see those beautiful boot up messages of RHEL 6.2 scroll through your screen.


- Lakshmivaragan
HCL Technologies Ltd,
Chennai, India
lakshmivaraganm at hcl dot com


by John VV on Wed, 2013-02-06 14:26
red hat has NEVER supported a " upgrade" between MAJOR versions

back up your date
do a new install of RHEL 6.3
import the data into 6.3
-- note some "sql" database tables will need a tool from rhel
contact them for the migration tools


  



All times are GMT -5. The time now is 09:15 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration