Skip to content
/ pkg Public

Package management tool for FreeBSD. Help at #pkg on Libera Chat or pkg@FreeBSD.org

License

Notifications You must be signed in to change notification settings

freebsd/pkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 28, 2025
36f9011 · Mar 28, 2025
Nov 21, 2024
Feb 26, 2025
Oct 30, 2024
Dec 27, 2024
Mar 28, 2025
Mar 6, 2025
Mar 28, 2025
Feb 12, 2025
Dec 11, 2024
Mar 28, 2025
Mar 28, 2025
Sep 17, 2024
Apr 5, 2024
Feb 24, 2025
Sep 7, 2018
Jan 17, 2015
Sep 20, 2012
Jan 2, 2019
Dec 22, 2012
Aug 1, 2022
Jan 5, 2023
Feb 9, 2025
Dec 23, 2024
Mar 28, 2025
Dec 4, 2024
Aug 18, 2021
Dec 3, 2024
Mar 28, 2025
May 2, 2018
Jan 18, 2024
Jan 17, 2022
Aug 28, 2014

Repository files navigation

pkg - a package manager for FreeBSD

  • Sourcehut FreeBSD: builds.sr.ht status
  • Sourcehut Alpine: builds.sr.ht status
  • Sourcehut Debian: builds.sr.ht status
  • Github Actions: build

Table of Contents:

libpkg

pkg is built on top of libpkg, a new library to interface with the package registration backends. It abstracts package management details such as registration, remote repositories, package creation, updating, etc.

pkg package format

The pkg package format is a tar archive that may be raw or compressed using one of the following algorithms: gz, bzip2, zstd, or xz. The default compression algorithm is zstd.

The tar archive itself is composed of two types of elements:

  • the special files at the beginning of the archive, starting with a "+"
  • the data.

Installing packages

pkg can install a package archive from the local disk, remote HTTP server or remote SSH server.

Pkg bootstrap

All supported versions of FreeBSD now contain /usr/sbin/pkg a.k.a pkg(7). This is a small placeholder that has just the minimum functionality required to install the real pkg(8).

To use, simply run any pkg(8) command line. pkg(7) will intercept the command, and if you confirm that is your intention, download the pkg(8) tarball, install pkg(8) from it, bootstrap the local package database and then proceed to run the command you originally requested.

More recent versions of pkg(7) understand pkg -N as a test to see if pkg(8) is installed without triggering the installation, and conversely, pkg bootstrap [-f] to install pkg(8) (or force it to be reinstalled) without performing any other actions.

Additional resources

To contact us, you can find us in the #pkg channel on Libera Chat IRC Network.

If you hit a bug when using pkg, you can always submit an issue in the pkg issue tracker.