AIX 6.1 OS Patches the Easy Way

Summary

Patching AIX can be intimidating at first for someone coming from the Windows / Linux world. AIX has capabilities that natively support production quality operations. One of these qualities is that one can install patches on an alternative volume, make that volume bootable for testing and allowing an easy way out if something doesn’t work right. Since AIX 5.3, it is also possible to install patches on the same volume as the boot volume and define boot profiles to boot at a certain patch level. In this post we will just look at the basics of patching, emulating the equivalent of “yum update” or the “windows express update” (taking Linux / Windows as analogy).

Steps

  • Download available patches for current technology level:
    smitty suma <Enter>
    Download Updates Now (Easy) <Enter>
    Download All Latest Fixes <Enter> <Enter>
  • Install patches:
    smitty update_all
    specify INPUT device: /usr/sys/inst.images/installp/ppc <Enter>
    go down to "ACCEPT new license agreements?" <Tab> (to switch to "yes") <Enter> <Enter>

That’s it. You can reboot in case there were kernel updates or APARs that recommend a reboot. To check the current patch level, you can run oslevel -s.


How to create or apply a patch?

Often programmers that haven’t worked with patches before find it intimidating. Patches are actually very simple to deal with. Here is how.

Creating Patches

diff -u oldfile newfile > filename.patch

or

diff -urN /olddir /newdir > filename.patch

or

diff -urN -X excludes /olddir /newdir > filename.patch

diff options:
-u Output (default 2) lines of unified context.
-r Recursively compare any subdirectories found.
-N Treat absent files as empty.
-X FILE Exclude files that match any pattern in FILE.

Note: The -u options can be replaced with -c to create a context format diff file with a setting of two lines.

Applying Patches

gzip -cd patch.gz | patch -p0

or

bzip2 -dc patch.bz2 | patch -p0

or

patch -p0 < filename.patch

patch options:
-p NUM Strip NUM leading components from file names.