Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2025 08:35:05 +0000
From:      Lexi Winter <ivy@freebsd.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Trying to understand base system packages
Message-ID:  <aTkwuRmEMIpc7UF1@amaryllis.le-fay.org>
In-Reply-To: <20251205122830.cb88058f193987b47a95a77c@gmail.com>
References:  <20251205122830.cb88058f193987b47a95a77c@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Sad Clouds wrote in <20251205122830.cb88058f193987b47a95a77c@gmail.com>:
> 1. Does "pkg upgrade" now upgrade both base and ports packages?

yes.

> If yes then what is the best way to override it and specify explicitly
> either base or ports?

use the -r flag to pkg upgrade.

> Is this the correct approach:
> # pkg upgrade -r FreeBSD-ports

yes.

> 2. Does "pkg upgrade" for base packages also merge etc files

yes, it will attempt a three-way merge.  if this fails, it will print
"pkg: Impossible to merge /etc/somefile" during the upgrade, and you
need to merge the file manually.  this message is very easy to miss, so
i suggest that after every upgrade, you search the entire filesystem for
files named '*.pkgsave' or '*.pkgnew'.

we intend to improve this UX in a later release.

> or do I need to manually execute etcupdate?

never run etcupdate on a pkgbase system.

> 3. In /etc/pkg/FreeBSD.conf FreeBSD-base is disabled by default. What
> is the reason for that?

because we don't want to enable this repository for non-pkgbase users.
the installer enables the repository in /usr/local/etc/pkg/repos for
pkgbase installs.

> Do I need to manually enable it if I want "pkg upgrade" to upgrade
> base packages in the future?

no, because the installer does this for you.

> 5. When building from source and executing "make release" this creates
> the traditional *.txz files. In addition to these, how do I also
> generate all of the base packages as part of the release?

"make -C release disc1.iso" will generate the pkgbase repository for the
installer media.

if you only want to generate packages, not release media, then use
"make update-packages".  you may want to set REPODIR before running
this; see build(7).

> There is release/pkgbase-repo directory that gets created but it is
> left empty.

this will not be empty if you build a release media that includes
packages.  note that bootonly does not include packages.

> Is running "make packages" a prerequisite before "make release" for
> this to happen

no.

> or is there a different release target for base packages?

no.

> 6. If I need to modify src.conf and build my own set of base packages,
> what is the recommended way to install/upgrade with these packages?

use "pkg install" to install them.

if upgrading a system installed from packages which used a different
src.conf, and you did not update the package version, you may need
"pkg upgrade -f" to replace the existing packages.

> Can I tell pkg to fetch the packages from a local directory?

yes:

FreeBSD-base: {
	url: "file:///build/packages/base/${ABI}/latest",
	enabled: yes
}

> The pkg(8) command supports options like -c (chroot dir), -r (root
> dir), etc, but I'm confused on how it should be used. For example:
> 
> I build a release for arm64/aarch64 on amd64, create a partition on
> microSD card and mount it under /mnt. I then execute 
> "tar -C /mnt -xpUf base.txz" to install the base system.
> 
> How do I replicate the above with pkg? Can anyone provide a quick
> example?

pkg -r /mnt install FreeBSD-set-minimal

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaTkwuQAKCRD1nT63mIK/
YHC6AQC/pZfzhxlVhe47eqn55i9MmtqPKKzTyp32BVFmiaDhuwEAznx1zS15XBNE
GRndkjSQ8y23n7OF78lj90BVnySUggQ=
=ZEfI
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aTkwuRmEMIpc7UF1>