Getting Redhat Updates (Patches/Update RPMs)


        Redhat provides a 'Redhat Network up2date' service which a paid service to get a latest updates from Redhat network. Most of these patches and latest RPMs are also available on Redhat FTP sites and lots of mirror website. Following 2 scripts will help to get these updates locally first and then apply on machine. Advantage of using such script is that you download patches only once in your network and then can be installed from the same fileserver over any Redhat machine. Use these scripts at your own risk.

Shell Script: 'get-updates' :
        By using 'wget' first it is going to get all RPMs (except kernel RPMs or whatever you choose to ignore). This will get all updates under i386, i586, i686 and noarch directories and store it locally. Just change the location of 'BASE_DIR' variable here as per your site. Run this time to time to get all latest updates. Next time it will only download missing updates RPMs.

Shell Script: 'apply-updates':
       Use this script on redhat box where updates need to be applied. Edit 'BASE_DIR' variable to point out where updates were stored using 'get-updates' script before. Also in order to avoid accident (to apply patches to wrong OS) change line shown below as per your OS version. For this just cat /etc/redhat-release file and cut and paste the line from there to line shown below in your script 'apply-updates'.

For example for Redhat 9. cat /etc/redhat-release will give us string:
'Red Hat Linux release 9 (Shrike)'
So add this string in following line in the script.

A=`grep "Red Hat Linux release 9 (Shrike)" /etc/redhat-release`

Now just run ./apply-updates to run update rpm commands. This will abort if you have any kernel RPMs in the update as you want to be little bit more careful with kernel updates, also warn you if there are any glibc updates as that is critical also. Author's suggestion is to apply test these scripts on some test system first before applying to any critical production system.