How to Update to Bash 4.2 on Solaris 9 or 10 (SPARC)
I had to update our UNIX hosts to Bash 4.2 this week. This allows us to take advantage of the newer BASH features not present in the shipping builds.
This article will:
- Show where you can get Bash 4.2 (binary) + Related dependencies
- Install them on your Sun Solaris 9 (SPARC) machine
Notes:
- sunfreeware.com
- Install Instructions (unixpackages.com)
- Solaris 9 only comes with Bash 2.5 by default
- Use an SCP program to copy the binaries over to your solaris machine
Since Bash 2.0.5 is WAY OLD and I want to use features found in v3.2 or later, here are steps for updating to bash 4.2 on Solaris 9
Part 1: Acquire the binary packages
- Download Libgcc (http://www.sunfreeware.com/programlistsparc9.html#libgcc34)
- Download Libiconv (http://www.sunfreeware.com/programlistsparc9.html#libiconv)
- Download Libintl (http://www.sunfreeware.com/programlistsparc9.html#libintl)
- Download Bash 4.2 (http://www.sunfreeware.com/programlistsparc9.html#bash)
NOTE: It looks like sunfreeware.com no longer provides the Solaris 9 packages for free. I am mirroring them here for future use:
- libgcc-3.4.6-sol9-sparc-local.gz
- libiconv-1.14-sol9-sparc-local.gz
- libintl-3.4.0-sol9-sparc-local
- bash-4.2-sol9-sparc-local.gz
Here are the links to the Solaris 10 packages (still available from sunfreeware.com):
- bash: http://www.sunfreeware.com/programlistsparc10.html#bash4
- Iconv: http://www.sunfreeware.com/programlistsparc10.html#libiconv
- libgcc: http://www.sunfreeware.com/programlistsparc10.html#libgcc34
- libintl: http://www.sunfreeware.com/programlistsparc10.html#libintl
Part 2: Transfer them via scp/sftp
Part 3: Install the packages
Run these commands:
- pkgadd -d libgcc
- pkgadd -d libiconv
- pkgadd -d libintl
- pkgadd -d bash
This should install the packages to /usr/local/bin. This DOES NOT overwrite the existing bash 2.0.5 installation.
Part 4: Get the new bash to replace the old one
This set of commands worked for me. Be careful here- test before running on an important machine!:
- ln /usr/local/bin/bash bash.link
- mv bash.link /bin
- mv /bin/bash /bin/bash.old
- mv bash.link bash
The point here is to not delete the old bash, just rename it so any new bash scripts that run will have the Bash 4.2 treatment. The old bash will be present as bash.old