[csw-users] Running pkgutil and OpenCSW as non-root?

Peter Bonivart bonivart at opencsw.org
Fri Jul 22 11:16:27 CEST 2011


On Fri, Jul 22, 2011 at 8:40 AM, Victor Hooi <victorhooi at yahoo.com> wrote:
> Hi,
> I'm hoping to use pkgutil and OpenCSW is a rather locked-down environment,
> where we do not have root access to the boxes.

I'm sorry to say but I think you will have little success with this.
:( Is there really no other option like having the sysadmin do
installs for you, have your own zone or something? Or get specific
sudo access?

> Basically, I need to run pkgutil as a normal user, and have it install all
> packages/libraries into it's own prefix (we do have a common directory which
> we have ownership of).
> Are there any notes or tricks we could use to achieve this? I couldn't seem
> to find anything on the wiki, and the nearest thing I could find was an old
> blog post from 2009, which involves simply extracting Solaris SVR4 packages,
> not quite what I wanted:
> http://blogs.oracle.com/LetTheSunShineIn/entry/non_root_install_of_blastwave
> 1. Getting pkg-util
> The first step is to get pkgutil. I have version 2.4 downloaded from here:
> http://buildfarm.opencsw.org/experimental/bonivart/pkgutil-2.4,REV=2011.06.29-SunOS5.9-all-CSW.pkg
> Since I don't have root access, I simply ran pkgtrans to get the actual
> files. I can run the pkgutil perl script itself, however I'm not sure what
> to do with the other required files in the archive (e.g. admin, etc,
> wget-i386/sparc etc.).
> How should I install properly pkg-util to run as non-root under a specific
> prefix (e.g. /my_prefix/)?

Take a look here how the files are laid out:
http://www.opencsw.org/search/pkgutil/. But it's only the admin file
that is important. By default if you're running pkgutil as non-root it
will create a ~/.pkgutil directory for the catalog, admin file and so
on. If you already have wget somewhere you don't need the included
one, it's just a last resort. Most options can be set on the command
line (every option with the --param option) but if you want a config
file you can put it anywhere and call it with --config.

> 2. Running pkg-util
>
> I saw it mentioned here, for version 2.0 of pkgutil that it has non-root
> abilities, but I'm not sure how to trigger this:
> http://pkgutil.wikidot.com/release-history#toc4
> What's the best way of running pkg-util as non-root, and having it install
> into our own prefix?

The problem is not pkgutil itself, it's that the Solaris pkg tools
(pkgadd/pkgrm and so on) are root-only when they modify stuff. So the
only things pkgutil can do as non-root are catalog related (like
pkgutil -a) and pure info commands like the ones calling pkginfo.

The other problem is that the packages themselves usually are not relocatable.

> 3. Local OpenCSW Mirror
> The other issue is that we don't have direct access from these machines to
> the internet (due to firewalling).
> What steps would I take to setup our own local OpenCSW mirror within our
> network (we probably can guess root access to this machine, assuming it
> doesn't have to be Solaris, and setup a webserver of our choice), and how
> should we go about pointing our pkg-util utility at this instance?

First you need to rsync from an official mirror, it's described on
www.opencsw.org/mirrors, then you just set your mirror options in
pkgutil.conf to point to your web server. You can also use the file://
protocol if it's an NFS share.

mirror=http://yourwebserver/csw
mirror=file:///cswshare

/peter


More information about the users mailing list