Wednesday, October 27, 2010

pkg-get utility in Solaris

Usually when you have to install any package in Solaris machine, using the traditional method of pkgadd you need to download the software and its dependencies, then sequentially attempt to install the dependencies + software. pkg-get is a great utility in Solaris, where you can install software from no.of different repositories without having to worry about the dependencies. Simply put its the apt-get of debian or yum of fedora system. Here's how you install pkg-get and use it.

- Download pkg-get: On the Solaris system you need to ensure that you have wget. In my system it was installed in /usr/sfw/bin/wget. However, /usr/sfw/bin was not in the PATH, hence I modified the PATH env variable like this `PATH=$PATH:/usr/sfw/bin`
Now download the pkg-get package like this `wget http://www.opencsw.org/pkg-get `
- Install pkg-get: `pkgadd -d pkg-get` . This will ask a few questions, answer them as usual and ensure CSWpkgget package is installed successfully.
- Initial configuration: The configuration file for pkg-get gets stored in /opt/csw/etc and the binary pkg-get in /opt/csw/bin. Add the bin path to global PATH. `PATH=$PATH:/opt/csw/bin`. Review the contents of pkg-get.conf file.
- Using pkg-get: To install a software say, MySQL Database, all you need to do it `pkg-get install mysql5`

Labels: , ,