pkg-unregister(8) (was: changing from pkgbase to regularbase)

From: Graham Perrin <grahamperrin_at_gmail.com>
Date: Fri, 26 Dec 2025 09:14:09 UTC
On 19/11/2025 14:17, void wrote to freebsd-current:

> A newly installed system was installed with pkgbase 


…

> … to properly un-pkgbase things?


With pkg 2.5.0 you can:


pkg unregister --force --glob 'FreeBSD-*'


A careless example, after using VirtualBox to take a snapshot of a guest 
(force is not generally recommended):


root@maximal:~ # freebsd-update fetch
freebsd-update is incompatible with the use of packaged base. Please see
https://wiki.freebsd.org/PkgBase for more information.
root@maximal:~ # pkg unregister --force --quiet --yes --glob 'FreeBSD-*'
root@maximal:~ # freebsd-update fetch
freebsd-update: Cannot upgrade from a version that is not a release
(including alpha, beta and release candidates)
using freebsd-update. Instead, FreeBSD can be directly
upgraded by source or upgraded to a RELEASE/RELENG version
prior to running freebsd-update.
Currently running: 16.0-CURRENT
root@maximal:~ # pkg -v
2.5.0
root@maximal:~ # env IGNORE_OSVERSION=yes pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from 
pkg+https://pkg.freebsd.org/FreeBSD:16:amd64/latest, please wait...
Verifying signature with trusted certificate 
pkg.freebsd.org.2013102301... done
Installing pkg-2.5.1...
package pkg is already installed, forced install
Extracting pkg-2.5.1: 100%
root@maximal:~ #


Additional information: at and around 
<https://mastodon.bsd.cafe/@grahamperrin/115774564178181702>.