Monday Oct 19, 2009

Here's how:

# Install pkg_* tools and the 'pkgin' package manager
$ pkgadd -d http://www.netbsd.org/~sketch/TNFpkgsrc-x86.pkg all

# Add tools to PATH
$ PATH=/opt/pkg/sbin:/opt/pkg/bin:$PATH

# Update package repository (akin to 'apt-get update')
$ pkgin up

# Search for a particular package (you can use regexp) 
$ pkgin search ^ap.*python 

# Install it
$ pkgin install ap22-py25-python

# Update all packages (akin to 'apt-get dist-upgrade')
$ pkgin full-upgrade

# How many packages are available?
$ pkgin avail | wc -l
   4970

Ok, so the headline might be slightly mis-leading, this isn't really apt-get but a tool which is very similar. This is work which builds upon my previous post using pkgsrc to build binary packages on Solaris.  See http://imil.net/pkgin/ for more information on pkgin.

Hopefully this will prove really useful to people still using Solaris 10 and unable to use the new pkg(5) stuff in OpenSolaris. Please try it out and provide any feedback to pkgsrc-users@netbsd.org.  I'm hoping to keep the packages updated for the 2009Q3 branch.

Comments:

I admit to being slightly biased, but this is incredibly neat. A nice way for Solaris users to see what pkgsrc provides, and a nice way for pkgsrc to look into the Solaris/x86 marketplace.

Posted by Alistair Crooks on October 19, 2009 at 03:25 PM BST #

Very nice.

Quick feature request: is there an easy way to check for downlevel packages on a running system, as compared to the repository (ala CSW's `pkg-get -c', or Sun's own `smpatch analyze')?

Posted by Jim Wise on October 19, 2009 at 09:58 PM BST #

Hi Jim,

There is, but it's kinda obscure right now. "pkgin search" prints comparison information for installed packages, so you could do something like:

$ pkgin search . | awk '$2 ~ /^[:<>]$/ { print }'

but obviously it'd be better if this was implemented natively. I'll ask imil if he has something in the pipeline for this.

Posted by Jonathan Perkin on October 20, 2009 at 12:09 PM BST #

Post a Comment:
  • HTML Syntax: NOT allowed