How to install software on SunOS
Solaris is a major pain and unfortunately several servers I have to deal with runs on it. Why is it a pain? Because for some reason it seems all Solaris machines are set up differently. Different sets of installed binaries, different places things are configured, and so on. Probably all caused by lazy sysadmins and/or developers.
Anyways, today I found out that curl wasn't installed in a server where i needed to test a SOAP request. After some hours of digging I finally managed to get a working curl installed, and figured I should document the procedure here in case I need it again, which I probably will...
Turns out there is a handy package manager called OpenCSW which luckily isn't too difficult to install. So from a mess to a mess with curl installed, here's what I did.
Setup OpenCSW
su -
pkgadd -d http://get.opencsw.org/now
exit
echo "export PATH=/opt/csw/bin:\$PATH" >> ~/.profile
echo "export MANPATH=/opt/csw/share/man:\$MANPATH" >> ~/.profile
exit
Install software
su -
pkgutil -a curl
pkgutil -y -i curl
exit
curl --version
Explanation
- Connect to server
- Switch to root user
- Install OpenCSW
- Switch back to regular user
- Update $PATH with OpenCSW paths
- Reconnect to server to get the new $PATH
- Switch to root user, hopefully taking our $PATH with us
- List packages named curl (also to make sure OpenCSW was installed OK)
- Install curl
- Switch back to regular user
- Check if curl was installed OK