User Tools

Site Tools


Pkgsrc Guide

Stale page

This guide refers to an unofficial pkgsrc mirror on github which appears to have fallen out of date. The official repositories should be used instead. The instructions need to be updated.


MINIX uses pkgsrc to port and maintain packages of third-party software. This guide will introduce you to the basics.

Getting started

1. Update MINIX periodically

2. Learn about pkgsrc

Going online

1. Create an account and add SSH keys at GitHub

2. Fork the MINIX 3 pkgsrc repository on GitHub You should clone the official repository from instead. Please update these instructions.

This makes your repositories similar, so that updates will be quick.

Setting up

1. Download your pkgsrc repository

First, download the official pkgsrc.

cd /usr

make pkgsrc

Then, add your remote repository.

cd /usr/pkgsrc

git remote add me

2. Create your minix-master branch

git fetch me

git branch my-minix-master me/minix-master

3. Check-out your minix-master branch locally

git checkout my-minix-master

Starting to port a package

Found something in pkgsrc that you want to port to MINIX?

  1. Create a new branch from it to host your work
git checkout -b my-package
  1. Install package tools
# cd /usr/pkgsrc/pkgtools/pkgdiff
# bmake install

This installs several tools we'll be using.

Making changes

  1. Get the package ready for editing
cd /usr/pkgsrc/[category]/[package]

bmake patch

This applies patches, but doesn't build. Build results aren't usable for patches.

  1. Go to the package's work directory
cd /usr/pkgsrc/work/[category]/[package]/work/[package name]
  1. Edit files
pkgvi somefile.c

Use EDITOR=nano pkgvi to use GNU nano instead of nvi.

  1. Go to the package directory
cd /usr/pkgsrc/[category]/[package]
  1. Make patches

rm patches/*.orig
  1. Make checksums
bmake makepatchsum
  1. Test your changes
bmake clean

  1. Save your work
cd /usr/pkgsrc/[category]/[package]

git add distinfo patches

git commit

The commit message should provide a summary of the change. The first line of the commit message should be in the form “[category]/[package]: summary of change.” Example: “print/ghostscript: add missing include”. If it's a complex change, the commit message should provide additional explanation.

Putting it online

Push this branch to your remote repository.

git push me my-package

This will let others test your changes and later include them in pkgsrc.

Telling people about it

When your branch is ready, let people know by posting to the Google Group.

Here's an example:

Subject: [package] Ported


I've ported [package], and my branch "my-package" is ready for testing at:[me]/pkgsrc.git


When the MINIX team agrees that the package changes in your GitHub repository, they will copy the changes into MINIX's pkgsrc repository.

Updating your changes

As changes in MINIX's pkgsrc repository become available, updating your repository allows your changes to merge cleanly in the future.

1. Update the official branch

git checkout minix-master

cd /usr

make pkgsrc-update

2. Make your minix-master branch identical to the official one

cd /usr/pkgsrc

git checkout my-minix-master

git rebase minix-master

3. Merge changes from either the official into your own

git checkout my-package-port

git merge my-minix-master

4. Push your local branch up to your repository

git push me my-package


Stuck or confused?

Please do your best to let people know what's happening. If you're having trouble or have an idea, then please tell someone.

The IRC channel and the Google Group are the best places for talking with the rest of the community.

Need to use https:// instead of git://?

If you use HTTPS and have an SSL-related problem when you fetch, then please use the following steps to install SSL certificates.

cd /usr/pkgsrc/security/mozilla-rootcerts

bmake install

cd /usr/pkg/etc/openssl/certs

mozilla-rootcerts extract

mozilla-rootcerts rehash


If you'd like to learn more about pkgsrc or need help, here are good places to go.

developersguide/pkgsrcguide.txt · Last modified: 2016/06/02 09:26 by