Re: Questions about pkgbase

From: S. Ross Gohlke <ross_at_bisd.ro>
Date: Thu, 02 Oct 2025 14:25:05 UTC
On 10/2/25 04:42, Yasuhiro Kimura wrote:
> Hi Lexi,
>
> Thanks for quick reply!
>
> From: Lexi Winter <ivy@freebsd.org>
> Subject: Re: Questions about pkgbase
> Date: Thu, 2 Oct 2025 10:17:30 +0100
>
>>> Then is there any way to (re|un)install all installed non-pkgbase
>>> packages?
>> this should be possible using 'pkg delete -r FreeBSD-ports', but
>> currently this option does not exist.  there is a feature request
>> to add it: https://github.com/freebsd/pkg/issues/2494.
> It solves the issue of `pkg-static delete -afy` but doesn't one of
> `pkg-static upgrade -fy`. IMHO option of pkg(8) should be added that
> limits target of action to either pkgbase pacakges or non-pkbbase
> ones.

pkg-query(8) evaluation format does not have variable for repository, 
but you can lock/unlock FreeBSD-base packages before/after:

# sh -c 'pkg query "%n %R" | grep " FreeBSD-base" | while read A B; 
do pkg lock -y $A; done'

# pkg-static upgrade -fy

...

# sh -c 'pkg query "%n %R" | grep " FreeBSD-base" | while read A B; 
do pkg unlock -y $A; done'

> BTW, it seems package name of all pkgbase packages starts with
> 'FreeBSD-'. On the other hand AFAIK ports framework don't prohibit to
> add port whose package name starts with 'FreeBSD-'. It seems
> confliction of package name may happen between base system and ports.
>
> ---
> Yasuhiro Kimura
>
Regards,

Ross