Let's suppose I'm working on a Solaris system without root access. Can I install OpenCSW packages in a directory other than
/opt/csw and get the packages to work?
asked: 2012-02-06 by: automaciej
I don't have a real experience on this kind of installation. Even though you can install in a different "root", there are so many caveats and, the probability to have more or less acute issues is fairly big...
OpenCSW packages, even when installation is triggered through
pkgutil, eventually get installed through
pkgadd which needs to run as root. This is a general limitation of the Solaris SVR4 packaging system. So, if you are a non-root user, the short answer is no, you can't install packages as a non-root user.
There's also the question of relocatability. Most packages carry hardcoded paths in their init scripts, configuration files, or binaries that point to
/opt/csw for various purposes (e.g. shared library lookup or resource paths). Thus, even if
pkgadd would allow you to install packages as non-root user (or you were root) and you would install to a different location than
/opt/csw, most installed OpenCSW programs would fail to load required data.
For very simple packages where you are only interested in running a single binary without further dependencies, you could work your way around it by manually extracting the package (using
pkgutil -Nd --extract <package>) and simply starting the binary from the extracted location.
For everything involving more advanced and imaginative workarounds (eg. extracting multiple packages, adjusting file paths, and fiddling with
LD_LIBRARY_PATH), you should really (!) know what you are doing and be aware of the definitive minefield, limitations, and maintenance horror you are getting yourself into. Definitely not recommended! It's likely just easier to kindly ask your local administrator to install the required packages in
/opt/csw for you or alternatively ask for a full-root zone / VM where you can install things yourself.
There are also
LD_LIBRARY_PATH_64, you can set the latter to
<somewhere>/lib/64 to enable 64-bit binaries to work.