pkgsrc on MirOS

Sponsored by
HostEurope Logo

pkgsrc on MirOS

⚠ This page contains old, outdated, obsolete, … historic or WIP content! No warranties e.g. for correctness!

pkgsrc is a “ports tree” developed by the NetBSD project and portable to several other operating systems. Support for MirOS has existed since 2006 in the form of a private patch. Since January 2011, MirOS support is contained in the upstream pkgsrc repository.

pkgsrc allows the easy installation of third-party software not contained in the base system. It is very similar to MirPorts, the ports framework developed by the MirOS project, “native” on MirOS. However, pkgsrc generally contains more and newer software.

For more information on pkgsrc, see

MirPorts and pkgsrc can be installed and used in parallel. However, there is one caveat: the package tools are incompatible but they have the same names. Thus, when installing packages, you must assure that the right ones are used. Moreover, when bootstrapping pkgsrc on MirOS, the MirPorts directories (normally /usr/mpkg/bin and /usr/mpkg/sbin) must not be in your PATH.

Binary packages

Pre-built binary packages of the pkgsrc-2013Q4 branch (from January 2014), built for recent MirOS-current, are available. They can be used even if you did not install a compiler on the system. The binary repository contains 7431 packages. The packages have been built with /usr/pkg as the prefix and /usr/pkg/var as VARBASE so that they are self-contained. You need root rights to use these packages. pkgsrc can also be installed as an unprivileged user but you will need to build from source in this case.

To install pkgsrc from binary packages, follow these steps:

  1. Download the bootstrap kit:
  2. Extract the file:
    cd / ; sudo tar xvpzf /path/to/bootstrap.tar.gz
  3. Set the PATH:
    export PATH=/usr/pkg/bin:/usr/pkg/sbin:$PATH
    (Add this line to your .profile to make the change permanent.)
  4. Update the package list for pkgin, the binary package manager:
    pkgin update
  5. Install the desired package(s), for example:
    pkgin install python27

More information can be found in Section 4.1 of the pkgsrc guide. More information on using pkgin for binary packages can be found on

Installation from source

  1. Check out pkgsrc, for example to /usr/pkgsrc:
    cd /usr ; cvs -qd co -P pkgsrc
  2. As above, prepend the pkgsrc directories to the PATH: export PATH=/usr/pkg/bin:/usr/pkg/sbin:$PATH
  3. Bootstrap pkgsrc. In this example, we install (using sudo) into /usr/pkg. The dbdir should be inside the prefix to avoid conflicts with MirPorts.
    cd bootstrap
    ./bootstrap --prefix /usr/pkg --pkgdbdir /usr/pkg/db
  4. pkgsrc can be configured by editing the /usr/pkg/etc/mk.conf file. See the pkgsrc Guide for details.
  5. To build and install a package, use the bmake command. For example, to install Perl:
    cd /usr/pkgsrc/lang/perl5
    bmake package-install clean
MirBSD Logo