Pkg-get: Setting up a Repository System for Solaris
Introduction
Package installation in Solaris is quite basic by default, and recompiling sources is not always simple or fast. This is why I suggest using pkg-get, which is a very practical utility that allows you to install your desired packages for Solaris (SPARC or x86) in just a few seconds or minutes.
Installation
New Method
The new method makes things much simpler:
pkgadd -d http://get.opencsw.org/now
Then add /opt/csw/bin
to your path:
export PATH=$PATH:/opt/csw/bin
And that’s it :-)
Old Method
First, you need wget! I suggest downloading it from these URLs:
Then place it in the /usr/bin/
directory of your Solaris. Rename it to wget to simplify the task:
mv /usr/bin/wget-i386.bin /usr/bin/wget
chmod 755 /usr/bin/wget
Next, add /opt/csw/bin
to your path:
export PATH=$PATH:/opt/csw/bin
This is obviously a temporary solution for your PATH, but I recommend adding it to the /etc/profile
file:
echo "export PATH=$PATH:/opt/csw/bin" >> /etc/profile
You should also have gzip installed (normally it’s included by default, but I prefer to specify it…). Now that wget is installed, we just need to download pkg_get:
wget http://www.blastwave.org/pkg_get-3.8-all-CSW.pkg
And let’s proceed with the installation:
pkgadd -d pkg_get-3.8-all-CSW.pkg
In response to the questions, answer all and yes every time :-).
Configuration
Let’s edit the /opt/csw/etc/pkg-get.conf
file to select the most appropriate mirror from this list.
Usage
Now that everything is set up, we can use it. First, update the list of available packages using pkg-get or pkgutil (depending on the version of opencsw you have):
pkg-get -U
or
pkgutil -U
To search (for example, for vim), use this command:
pkg-get -a
And then to install it:
pkg-get install vim
or
pkgutil -i vim
It’s not complicated and saves a tremendous amount of time :-)
Last updated 23 Jan 2013, 10:54 +0200.