Getting the best out of pkgsrc (by )

However, you'll notice that after the pkg_chk -r, until pkg_chk -a has finished, you're left without much installed software while it's all being rebuilt. Which sucks a bit for a live server, doesn't it?

Well, pkgsrc does have the facility to build "binary packages" from pkgsrc. .tgz files that can be installed with the pkg_add command, which basically just unpacks the contents and then registers them in the package database, which is fast.

If you have spare hardware, or a Xen virtual server setup, you can create a virtual machine in which you deinstall everything, build up what you want, and then create binary packages, which you can then upgrade to on your live servers in as long as it takes to unpack the .tgz files. However, there's another way - with a chroot.

I'm currently experimenting with this myself, but you can create a sandbox environment that looks like a basic NetBSD install. It's not a copy of the install that takes up space, but a read-only reference to what you have installed already, with the /usr/pkg directory taken away. You then build up the packages in there and make binary packages, while leaving your real system undisturbed. You can then install the resulting binary packages into the real system in a flash.

The pkgsrc manual has instructions for creating a sandbox for bulk builds, which I'm in the process of experimenting with adapting to using with pkg_chk to build only the packages you want. I'll post my results in a later installment...

UPDATED 20090806: Removed discussion of audit-packages, as it's part of pkgsrc by default now.

Pages: 1 2 3

4 Comments

  • By Ben, Mon 5th Mar 2007 @ 8:26 am

    OpenBSD discourages use of processor specific optimisations as reveals bugs in the compiler which produce incorrect code. Does this not apply here?

  • By alaric, Mon 5th Mar 2007 @ 10:51 am

    Revealing the bugs would be a good first step to fixing them 😉

  • By Ben, Mon 5th Mar 2007 @ 10:57 am

    You are very kind to offer your production server as a test bed for the community's benefit.

  • By Matt, Wed 7th Mar 2007 @ 8:19 pm

    Kind, of Craaaaaaaaaaaaazy!

Other Links to this Post

RSS feed for comments on this post.

Leave a comment

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales