Search code examples
macososx-lionfailed-installationnetbsd

Issue completing the install script for pkgin/pkgsrc for OSX 10.7, segfault running pkgin


In attempting to install pkgin/pkgsrc (NetBSD-based package managment tools), using the saveosx.org instructions and github repository.

The repository has installation instructions, which I followed, up to the point of a specific but uninformative error:

It looks like there was an issue running: sudo /usr/pkg/bin/pkgin -y update

I tried running this file directly, but my terminal reports a segmentation fault.

I'm running OSX 10.7.5 and have Xcode-Command-Line Tools installed, but I find no information about Darwin version compatibility on NetBSD's site. My searches have revealed no one else reporting issues using pkgin.

Version 5.0+ is supported according to www.netbsd.org/docs/pkgsrc/platforms.html#darwin, which according to wikipedia (en.wikipedia.org/wiki/Darwin_%28operating_system%29#Release_history) corresponds to OSX 10.1.1+

What options do I have besides upgrading my operating system and hoping the problem is fixing by having newer libraries or a newer kernel?

For reference:

  • www.pkgsrc.org/#docs
  • www.perkin.org.uk/pages/pkgsrc-binary-packages-for-osx.html
  • wiki.netbsd.org/pkgsrc/pkgsrc_64bit_osx/
  • Related question: Unable to run pkgin on Mac OSX

Solution

  • It would appear that the pkgin binary currently supplied by saveosx is compiled only for more recent OSX releases. It needs at least a Darwin-14.x kernel, or newer, so it won't even run on 10.9.5. Unfortunately the script fails to check the OSX version before it blindly tries to run the pkgin binary, causing the program to crash.

    saveosx is basically a painfully obnoxious, rather ugly, and poorly implemented. set of scripts that are superfluous to actually using pkgsrc on OSX.

    I would strongly recommend avoiding saveosx for the time being.

    Instead I would recommend trying the following well supported alternative:

    OSX binary pkgsrc packages

    A 32-bit Snow Leopard version that runs on 10.6.8 and newer is available, and I just checked the distribution directory and I see some 2015Q1 i386 packages are just now available, still supporting 10.6.8:

    2015Q1 32-bit (i386) Snow Leopard and newer pkgsrc bootstrap

    You can of course also build your own pkgsrc bootstrap for any specific OSX environment:

    pkgsrc home