Chapter 1. What is pkgsrc?

Table of Contents

1.1. Introduction
1.2. Overview
1.3. Terminology
1.4. Typography

1.1. Introduction

There is a lot of software freely available for Unix-based systems, which usually runs on NetBSD and other Unix-flavoured systems, too, sometimes with some modifications. The NetBSD Packages Collection (pkgsrc) incorporates any such changes necessary to make that software run, and makes the installation (and de-installation) of the software package easy by means of a single command.

Once the software has been built, it is manipulated with the pkg_* tools so that installation and de-installation, printing of an inventory of all installed packages and retrieval of one-line comments or more verbose descriptions are all simple.

pkgsrc currently contains several thousand packages, including:

...just to name a few.

pkgsrc has built-in support for handling varying dependencies, such as pthreads and X11, and extended features such as IPv6 support on a range of platforms.

pkgsrc was derived from FreeBSD's ports system, and initially developed for NetBSD only. Since then, pkgsrc has grown a lot, and now supports the following platforms:

1.2. Overview

This document is divided into two parts. The first, The pkgsrc user's guide, describes how one can use one of the packages in the Package Collection, either by installing a precompiled binary package, or by building one's own copy using the NetBSD package system. The second part, The pkgsrc developer's guide, explains how to prepare a package so it can be easily built by other NetBSD users without knowing about the package's building details.

This document is available in various formats:

1.3. Terminology

There has been a lot of talk about “ports”, “packages”, etc. so far. Here is a description of all the terminology used within this document.

Package

A set of files and building instructions that describe what's necessary to build a certain piece of software using pkgsrc. Packages are traditionally stored under /usr/pkgsrc.

The NetBSD package system

This is the former name of “pkgsrc”. It is part of the NetBSD operating system and can be bootstrapped to run on non-NetBSD operating systems as well. It handles building (compiling), installing, and removing of packages.

Distfile

This term describes the file or files that are provided by the author of the piece of software to distribute his work. All the changes necessary to build on NetBSD are reflected in the corresponding package. Usually the distfile is in the form of a compressed tar-archive, but other types are possible, too. Distfiles are usually stored below /usr/pkgsrc/distfiles.

Port

This is the term used by FreeBSD and OpenBSD people for what we call a package. In NetBSD terminology, “port” refers to a different architecture.

Precompiled/binary package

A set of binaries built with pkgsrc from a distfile and stuffed together in a single .tgz file so it can be installed on machines of the same machine architecture without the need to recompile. Packages are usually generated in /usr/pkgsrc/packages; there is also an archive on ftp.NetBSD.org.

Sometimes, this is referred to by the term “package” too, especially in the context of precompiled packages.

Program

The piece of software to be installed which will be constructed from all the files in the distfile by the actions defined in the corresponding package.

1.4. Typography

When giving examples for commands, shell prompts are used to show if the command should/can be issued as root, or if “normal” user privileges are sufficient. We use a # for root's shell prompt, and a % for users' shell prompt, assuming they use the C-shell or tcsh.