How to manually download, compile and install RHEL 6 updates

Author: | Posted in howto No comments

As it turned out firefox 20 available from the Remi repository doesn’t install on earlier releases of RHEL6 (such as RHEL6.3), it is only compatible with RHEL 6.4 as its dependency xulrunner-last was compiled against newer versions of zlib and libjpeg-turbo. If you have an active RHEL 6.subscription you have to update zlib and install libjpeg-turbo (which obsoletes libjpeg) and then firefox 20 will install fine.

If you don’t have an active subscription (i.e. RHN access) you can still get the RPMs. You can either download the updated versions of the 2 RPMs from one of the CentOS 6 repository mirrors, or you can download the source RPMs (src.rpm) from Red Hat and rebuild them. Note that this is not the recommended way of updating a production system, this is just to show there are alternatives to the official way of getting RHEL updates. Basically CentOS, Scientific Linux and other RHEL clones are doing the same thing: rebuild source RPMs.

I used a RHEL 6.3 minimal installation for this tutorial, my goal was to recompile more recent versions of zlib and libjpeg-turbo to allow the installation of firefox 20, here’s what I did:

 

1. install the required tools to build RPMs

Since I already had a local RHEL 6.3 repository configured, I could easily install everything with yum:

yum groupinstall "Development tools"
yum install rpm-build rpmdevtools
yum install nasm

Note: The last command was needed to install a dependency required for building libjpeg-turbo.

 

2. create the rpmbuild directory structure

rpmdev-setuptree

This will create a folder structure in the user’s home directory (it is advised to build RPMs as a non-root user):

ls ~/rpmbuild
BUILD BUILDROOT RPMS SOURCES SPECS SRPMS

 

3. download the source RPMs

wget ftp://ftp.redhat.com/redhat/linux/enterprise/6Server/en/os/SRPMS/zlib-1.2.3-29.el6.src.rpm
wget ftp://ftp.redhat.com/redhat/linux/enterprise/6Server/en/os/SRPMS/libjpeg-turbo-1.2.1-1.el6.src.rpm

 

4. rebuild the source RPMs

rpmbuild --rebuild zlib-1.2.3-29.el6.src.rpm
rpmbuild --rebuild libjpeg-turbo-1.2.1-1.el6.src.rpm

 

5. install the newly built RPMs

That’s it, the packages were successfully recompiled, so the new RPMs should be available under ~/rpmbuild/RPMS/x86_64.

yum localupdate ~/rpmbuild/RPMS/x86_64/zlib-1.2.3-29.el6.x86_64.rpm
yum localinstall ~/rpmbuild/RPMS/x86_64/libjpeg-turbo-1.2.1-1.el6.x86_64.rpm

 

After installing the 2 new packages I was able to install firefox 20 without issues.

 

Notes:

  • again, this is not the recommended way to update your system. If you want a Red Hat-compatible OS, choose one of its clones (CentOS, Scientific Linux, Oracle Linux)
  • in theory, you can use this approach and rebuild all updates published by Red Hat, however that is not always easy. Some source RPMs don’t include a spec file, others need extra dependencies for the build process which are not explicitly defined in the spec file, you can read some of the issues faced by the team behind Scientific Linux
  • all source RPMs published by Red Hat for RHEL6 are available here

 

Hope this helps. Cheers.

No Responses

Add Your Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.