How to upgrade to Python 2.7 in Solaris 11

Following are simple steps to upgrade from default version (python 2.6.8) to python 2.7 in Solaris 11. Many of the python frameworks are build on top of python 2.7. Hence this might be a good fix to  solve many problems.

Download and install python 2.7 to your system using the following commands.

$ pkgadd -d http://get.opencsw.org/now
$ /opt/csw/bin/pkgutil -U
$ /opt/csw/bin/pkgutil -y -i python27 
$ /usr/sbin/pkgchk -L CSWpython27 # list files

The new version of python gets installed in the directory  /opt/csw/bin. Inorder to make the default version to the latest one, create a symbolic link as root to the new binary file:

$ ln -sf /usr/bin/python2.6 /usr/local/bin/python
Advertisements