Page MenuHomeFreeBSD

freebsd-base.7: Add an example for unregistering
Needs ReviewPublic

Authored by ziaee on Feb 23 2026, 1:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 23, 3:07 PM
Unknown Object (File)
Fri, Mar 20, 7:50 AM
Unknown Object (File)
Thu, Mar 19, 8:23 AM
Unknown Object (File)
Thu, Mar 19, 2:54 AM
Unknown Object (File)
Wed, Mar 18, 3:01 AM
Unknown Object (File)
Tue, Mar 17, 5:32 PM
Unknown Object (File)
Tue, Mar 17, 2:41 AM
Unknown Object (File)
Mon, Mar 16, 11:15 AM
Subscribers

Details

Summary
MFC after:              3 days
Discussed with:            bapt, des, emaste, ivy, phk, pi
Differential Revision:  https://reviews.freebsd.org/D55458
Test Plan

Someone is going to have to do it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71350
Build 68233: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
ziaee requested review of this revision.Feb 23 2026, 1:34 PM

i would like to see a bit more prose to explain what this command actually does, probably in its own (sub)section. in particular, explain that it unregisters the packages without removing the files ("depkgbasify" is inside baseball terminology, users won't know what this means), and explain why you'd want to do that: mainly, because it prevents the package database from becoming inconsistent with the installed system. also, should mention that it's not easily reversible and would require the system be re-pkgbasified to undo.

share/man/man7/freebsd-base.7
225

this should be FreeBSD-*, there are no pkgbase packages whose names start with FreeBSD-base-.

225

also, you might need -f here, at least if you have ports installed, because of dependency issues.

227

don't use > as this will overwrite the contents of any existing file the user might have created. also, bsdinstall creates its own file called FreeBSD-base.conf, which is the one you'd want to change.

i suggest replacing this with prose: in most cases, /usr/local/etc/pkg/repos/FreeBSD-base.conf can simply be deleted, since the base repository is disabled by default in /etc/pkg/FreeBSD.conf.

228

this should not be necessary since pkg shouldn't remove itself. that would only happen if you did pkg unregister -a.

also: there are ports packages whose names begin with freebsd- (in lowercase); i think pkg is now case sensitive here, but someone should test that to make sure it won't randomly unregister those ports.

des added inline comments.
share/man/man7/freebsd-base.7
225

concur with @ivy + would add pkg remove FreeBSD-src-\* as a first step since presumably they're going to git clone it instead. Oh, and asterisks need to be escaped.

share/man/man7/freebsd-base.7
225

also also, you need quotes here: pkg unregister 'FreeBSD-*', to prevent the shell doing glob expansion.

225

my last comment crossed with yours, ofc using \* is also fine.

+ add pkg del freebsd-src
+ escape wildcard
+ change echo redirection to append
+ remove pkg bootstrap

Refactoring this entire examples section into something that will look
nice with subsections is out of scope of this commit. It's a good sized,
bikesheddable job just in of itself. Lets get this in, if it's accurate
now, and one of us can attempt that next.

one other thing that comes to mind is that pkg unregister was added in pkg 2.5.0, but, iirc, we only shipped 2.4.something on the 15.0 media. that won't be an issue for most people because you can just update pkg, but if you did an offline install of 15.0, and wanted to depkgbasify it before doing anything else, this wouldn't work. this will be a non-issue once 15.1 comes out and maybe it's minor enough to not be worth mentioning...

share/man/man7/freebsd-base.7
225

the two packages we want to remove here are FreeBSD-src and FreeBSD-src-sys.

share/man/man7/freebsd-base.7
225

Are these normally marked vital if installed? If so, you need -f to remove them.

emaste added inline comments.
share/man/man7/freebsd-base.7
221

It's not clear what "De-pkgbasify" means -- the "pkgbase" short name does not appear anywhere in this page prior to this change, and this doesn't explain what effect this command will have on the system. The user might think it's going to remove their base system packages.

Maybe something like "Remove base system pkg(8) metadata, for use with ..."

We could also mention that it can be done for building from src or use with freebsd-update.

share/man/man7/freebsd-base.7
221

Or "Delete src packages and remove base system metadata for the remaining packages"

share/man/man7/freebsd-base.7
225

no, but FreeBSD-set-src is, which i forgot about. so to remove all three we'd need -f. it might be easier to just tell the user to unregister everything then delete /usr/src if they want to clone it...

remove de-pkgbasify
remove src removal. unregister everything, then managing their source
tree is part of their source build phase.

Thanks, this looks good. The only thing I think we should add is a warning about the consequence of doing so -- i.e., that the user will not be able to update via base system packages.

@emaste good point. I tweaked everything a bit too.

share/man/man7/freebsd-base.7
229

i'm still not sure this makes sense because you'll end up with a file containing

FreeBSD-base: { enabled: yes }
FreeBSD-base: { enabled: no }

which is strange and confusing. it's better to explain that the user should disable the base repository, e.g. by removing this file, so it's clear why we're doing this.

share/man/man7/freebsd-base.7
229

I am open to concrete suggestions to improve this, but we should have working examples. The example should be explained well enough to understand what's going on. I do not want to implement that change because I want to have working examples.

share/man/man7/freebsd-base.7
229

I am open to concrete suggestions to improve this,

i doubt this, because i suggested several and your response was "this is out of scope" (because we can't have prose in EXAMPLES, or something). so whatever.

ziaee retitled this revision from freebsd-base.7: Document de-pkgbasify to freebsd-base.7: Add an example for depkgbase.Thu, Feb 26, 6:59 AM

i doubt this,

Rude.

because i suggested several and your response was "this is out of scope" (because we can't have prose in EXAMPLES, or something). so whatever.

You gave some instruction to one of our teammates how to do something that wasn't written down. I am just trying to write it down so that we can have one less of this problem where "how to use pkgbase" is a secret that people can only get from talking to you. This is not about not having prose in EXAMPLES where it obviously is in every single manual page that has examples, it's that having blocks of prose in a single example requires me to produce subsections for all the other examples. This is both yak shaving and very obviously out of the scope of this commit.

You do not have to make me shave this yak in order to have any progress at all. Nevertheless, at 2 A.M. I have shaved this yak for you in what is now added as the parent revision.

  • forgot to quote FreeBSD-\*
  • switch to rm freebsd-base repo conf
  • switch to example 7, this should be proceeded by an enrolling example
ziaee retitled this revision from freebsd-base.7: Add an example for depkgbase to freebsd-base.7: Add examples for converting.Fri, Feb 27, 5:07 AM
ziaee edited the summary of this revision. (Show Details)
ziaee edited the test plan for this revision. (Show Details)

rewrite with converting to pkgbase so we can think hollistically.

ziaee marked 14 inline comments as done.Fri, Feb 27, 5:14 AM
ziaee edited the test plan for this revision. (Show Details)

add info about repos. notably, i am lying about pkg unregister -r,
i know pkg unregister doesn't support repos yet, but i am proposing
it does, or that someone else proposes how we are supposed to do this,
or admits that we have no plan how people are supposed to upgrade.

remove example numbers. note they are requested in style.mdoc(5).

share/man/man7/freebsd-base.7
230

the user may have an existing FreeBSD.conf, especially if they upgraded from 14.x or earlier. i suggest not recommend to unconditionally overwrite this.

241

this is not correct if the existing system doesn't match the pkg repository (e.g., src.conf differences). converting an existing system to pkgbase is a rather complicated process and i'm not sure this should be documented in the manpage at all... it might make more sense to include this in the 16.0 release notes, assuming we drop freebsd-update at that time.

252

it's not, pkg unregister is fully supported.

255

do they? why? i thought this had been fixed by making pkg case sensitive by default.

260

would rather say something like "via make installworld". you can upgrade pkgbase systems from source without depkgbasifying them.

270

again, the user may have existing content in this file that we can't just unconditionally delete.

i don't think the expanded scope of this diff is necessary. can we just document how to depkgbasify a system? that is the more important case, because we need to support people who install from disc1.iso with pkgbase and now need to depkgbasify to upgrade via installworld.

Yes, let's start with just deregistering packages to allow for installworld.

share/man/man7/freebsd-base.7
260

I assume you mean by building packages from that source and installing them? Good point, "upgrade in-place via source" does not need to imply installworld.

share/man/man7/freebsd-base.7
260

yes, precisely that.

  • remove example for converting to pkgbase
  • remove warning

Note I did not remove deleting the repo. You didn't like it when I told them to non-destructively append a line disabling it and you dont like it when I tell them to delete it. This is very difficult for me. We all want the same thing right? Will you suggest a working example that is acceptable to you?

I'm falling behind for this topic. Does this mean starting from pkg 2.5, we don't need pkgbasify? Also what version of FreeBSD support this? Some might have pkg 2.5 but not have FreeBSD-base in its conf file.

This is subject to MFC but let's make clear that this isn't for stable/14.

I'm falling behind for this topic. Does this mean starting from pkg 2.5, we don't need pkgbasify? Also what version of FreeBSD support this? Some might have pkg 2.5 but not have FreeBSD-base in its conf file.

Nvm. I see the diff was updated before I clicked submit.

I'm falling behind for this topic. Does this mean starting from pkg 2.5, we don't need pkgbasify? Also what version of FreeBSD support this?

No, it means we have a solution for people to depkgbasify. Target support is 15 branches, I think.

This is subject to MFC but let's make clear that this isn't for stable/14.

Yes, if you look at the commit message trailer, I did that.

ziaee retitled this revision from freebsd-base.7: Add examples for converting to freebsd-base.7: Add an example for unregistering.Wed, Mar 11, 4:36 PM
ziaee added inline comments.
share/man/man7/freebsd-base.7
236

To be clear, this is what I suggested originally. Again, I am open to other suggestions.

add -g from @ivy's comment on the mailing list.

share/man/man7/freebsd-base.7
236

Isn't FreeBSD-base disabled by default?

minsoochoo@altra:~ $ cat /etc/pkg/FreeBSD.conf
#
# To disable a repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file, e.g.:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD-ports: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#   echo "FreeBSD-ports-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf
#
# Note that the FreeBSD-base repository is disabled by default.
#
236

Nvm. I didn't read the change properly.

share/man/man7/freebsd-base.7
236

I think your original change is better. Many people have set latest branch in /usr/local/etc/pkg/repos/FreeBSD.confand removing the file would remove other configs as well.

I don't know the outcome when echo "FreeBSD-base: { enabled: no } >> FreeBSD-base.conf while there is "FreeBSD-base: { enabled: yes }. It would end up like:

FreeBSD-base: { enabled: no }
FreeBSD-base: { enabled: yes }

I would suggest:

If you have enabled FreeBSD-base in /usr/local/etc/pkg/repos/FreeBSD.conf, disable it.

Revert to showing the disable text, which will always work because pkg
parses the last thing. add a squirrely statement saying to remove the
config file if they made one.

share/man/man7/freebsd-base.7
236

this is the wrong filename in most cases: systems installs via bsdinstall, and the pre-built VM images, will have the base repository enabled in FreeBSD-base.conf.

it would only be in FreeBSD.conf if the user had manually configured pkgbase on an existing system, which is possible, but less common. (i am not sure what pkgbasify does off hand.)

add -g from @ivy's comment on the mailing list.

i'm fairly sure this is not required, i just copied it from des's earlier mail.

share/man/man7/freebsd-base.7
220

i think we need to decide on some consistent terminology here. at the moment we describe this process as "unenrolling", "disassociating", and (for the inverse case) "registering", all in the same manpage, which is potentially confusing.

i don't like "(de)pkgbasifying" for the reasons i mentioned before. i think i have a mild preference for either "(un)enrolling" (the semantic action) or "(un)registering" (the pkg(8) terminology), but probably anything is fine as long as it's consistent.

256

this is true, but strange to mention since we don't discuss pkgbasifying anywhere in the manpage right now. should this say "unregistering" instead?