Packaging FreeBSD base

About PkgBase

PkgBase is the FreeBSD base operating system (OS), packaged.

Use of pkg(8) is the norm for installation of, and updates to, ported software that runs on the OS.

Where it becomes possible to also use pkg for the OS:

Status

Packages are published for all arches provided they are listed in

branch

publication frequency

url

main

twice a day at 12:00 and 00:00 UTC

https://pkg.freebsd.org/${ABI}/base_latest

main

weekly on sunday at 12:00 UTC

https://pkg.freebsd.org/${ABI}/base_weekly

stable/14

twice a day at 12:00 and 00:00 UTC

https://pkg.freebsd.org/${ABI}/base_latest

stable/14

weekly on sunday at 12:00 UTC

https://pkg.freebsd.org/${ABI}/base_weekly

releng/14.0

twice a day at 12:00 and 00:00 UTC

https://pkg.freebsd.org/${ABI}/base_release_0

publication only happens if there was actually new packages built since the latest publication, releng are usually quite low update branches

Packages will be provided from FreeBSD 14.0 onwards:

In addition, to aid exploration and adoption, an unofficial repository https://pkg.freebsd.evilham.com/images is provided by Evilham (Andrés).

In Bugzilla:

Use of a virtual machine, or a dedicated test machine, is encouraged.

Overview

PkgBase comprises a few hundred packages with the default build (empty src.conf(5) and make.conf(5)) for amd64. The number of packages depends on several factors.

In most cases, a runtime binary is split into multiple components. Debugging symbols and most shared libraries are packaged individually. 32-bit is bit packaged separately.

Initial setup

  1. Ensure your pkg(8) version is at least 1.20.9

  2. Use FreeBSD 14.0 at minimum (14.0 will be assumed in the steps below)
  3. Create a directories for pkg repositories and add the pkgbase one
    # mkdir -p /usr/local/etc/pkg/repos/
    # cat <<EOF >/usr/local/etc/pkg/repos/base.conf
    
    > base: {
    >   url: "pkg+https://pkg.FreeBSD.org/\${ABI}/base_release_0",
    >   mirror_type: "srv",
    >   signature_type: "fingerprints",
    >   fingerprints: "/usr/share/keys/pkg",
    >   enabled: yes
    > }
    > EOF
  4. Update the repositories
    # pkg update
    Updating FreeBSD repository catalogue...
    FreeBSD repository is up to date.
    Updating base repository catalogue...
    Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
    Fetching packagesite.pkg: 100%   33 KiB  33.9kB/s    00:01    
    Processing entries: 100%
    base repository update completed. 421 packages processed.
    All repositories are up to date.
  5. Install all base packages
    # pkg install -r base  -g 'FreeBSD-*'
    New packages to be INSTALLED:                                  
            FreeBSD-acct: 14.rc4.20231103061237 [base]                                                                             
            FreeBSD-acct-dbg: 14.rc4.20231103061237 [base]                                                                         
            FreeBSD-acpi: 14.rc4.20231103061237 [base]                                                                             
            FreeBSD-acpi-dbg: 14.rc4.20231103061237 [base]
    ...
            FreeBSD-zfs-dev-lib32: 14.0p2 [base]
            FreeBSD-zfs-lib32: 14.0p2 [base]
            FreeBSD-zoneinfo: 14.rc4.20231103061237 [base]
    
    Number of packages to be installed: 421
    
    The process will require 4 GiB more space.
    1 GiB to be downloaded.
    
    Proceed with this action? [y/N]:y
  6. Deal with .pkgsave

If a file that was already present on the disk differs from what is inside the package holding this file, pkg(8) will backup the old one as .pkgsave This is the same for config files, pkg(8) will not be able to merge them all if they were modified.

Those files above are the minimum that you should check and restore, other ones might exists.

Upgrades

To upgrade just simply pkg update && pkg upgrade

Major version upgrades

When attempting a major upgrade of FreeBSD (e.g. from 11 to 12), you may find the following error:

For this case, the following command will allow a successful upgrade:

Outstanding

Please follow up on the freebsd-pkgbase@ mailing list with problems (and successes).

Goals, and additional unresolved issues

The following items need to be addressed before PkgBase can be considered for production use:

Retrospective

A call for testing was made in March 2016.

Major blockers and critical issues appeared to be resolved.

Glen Barber's notes from the packaging session at the 2017-08 BSDCam devsummit

Userland packages sets – can someone clarify what exactly this means?

TODO:

Package containing the source tree that a [base] package set was built from. Note: while I think this is a good idea, I have concerns about behavioral consistency between pkg upgrade and svn up ''/usr/src''. Some things that come to mind immediately are:

  1. locally-patched source trees and losing patches on pkg upgrade;

  2. svn up changing checksums recorded in the pkg(8) database;

  3. ultimately "Which one wins?" in an update of /usr/src?

Add SVN rev of source tree to pkg metadata (or equivalent, plus indicate if the tree has been modified similarly to uname(1)) (Note: committed as r322412.)

RDBMS-backed web application to collect file checksums from every official package and allow users to verify files on-line.

Using pkgdb as an IDS?


CategoryProject CategoryTodo

PkgBase (last edited 2024-01-15T14:38:34+0000 by MateuszPiotrowski)