/ README.md
README.md
 1  pkg - a package manager for FreeBSD
 2  ====================================
 3  
 4   * Sourcehut FreeBSD: [![builds.sr.ht status](https://builds.sr.ht/~bapt/pkg/commits/master/freebsd.svg)](https://builds.sr.ht/~bapt/pkg/commits/master/freebsd?)
 5   * Sourcehut Alpine: [![builds.sr.ht status](https://builds.sr.ht/~bapt/pkg/commits/master/alpine.svg)](https://builds.sr.ht/~bapt/pkg/commits/master/alpine?)
 6   * Sourcehut Debian: [![builds.sr.ht status](https://builds.sr.ht/~bapt/pkg/commits/master/debian.svg)](https://builds.sr.ht/~bapt/pkg/commits/master/debian?)
 7   * Github Actions: [![build](https://github.com/freebsd/pkg/actions/workflows/build.yaml/badge.svg)](https://github.com/freebsd/pkg/actions/workflows/build.yaml)
 8  
 9  Table of Contents:
10  ------------------
11  
12  * [libpkg](#libpkg)
13  * [pkg package format](#pkgfmt)
14  * [Installing packages](#pkginst)
15  * [pkg bootstrap](#pkgbootstrap)
16  * [Additional resources](#resources)
17  
18  
19  <a name="libpkg"></a>
20  ### libpkg
21  
22  pkg is built on top of libpkg, a new library to interface with the package
23  registration backends.
24  It abstracts package management details such as registration, remote
25  repositories, package creation, updating, etc.
26  
27  <a name="pkgfmt"></a>
28  ### pkg package format
29  
30  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`.
31  
32  The tar archive itself is composed of two types of elements:
33  
34  * the special files at the beginning of the archive, starting with a "+"
35  * the data.
36  
37  <a name="pkginst"></a>
38  ### Installing packages
39  
40  pkg can install a package archive from the local disk, remote HTTP server or
41  remote SSH server.
42  
43  <a name="pkgbootstrap"></a>
44  ### Pkg bootstrap
45  
46  All supported versions of FreeBSD now contain /usr/sbin/pkg a.k.a
47  *pkg(7)*.  This is a small placeholder that has just the minimum
48  functionality required to install the real pkg(8).
49  
50  To use, simply run any pkg(8) command line.  pkg(7) will intercept the
51  command, and if you confirm that is your intention, download the
52  pkg(8) tarball, install pkg(8) from it, bootstrap the local package
53  database and then proceed to run the command you originally requested.
54  
55  More recent versions of pkg(7) understand `pkg -N` as a test to see if
56  pkg(8) is installed without triggering the installation, and
57  conversely, `pkg bootstrap [-f]` to install pkg(8) (or force it to be
58  reinstalled) without performing any other actions.
59  
60  <a name="resources"></a>
61  ### Additional resources
62  
63  * The Git repository of [pkg is hosted on GitHub](https://github.com/freebsd/pkg)
64  
65  To contact us, you can find us in the **#pkg** channel on [Libera Chat IRC Network](https://libera.chat/).
66  
67  If you hit a bug when using pkg, you can always submit an issue in the
68  [pkg issue tracker](https://github.com/freebsd/pkg/issues).