installing world from src on a pkgbase system

0 views
Skip to first unread message

Wis...@proton.me

unread,
Mar 25, 2026, 3:44:03 PM (8 days ago) Mar 25
to freebsd...@freebsd.org, freebsd-...@freebsd.org
Hi there, i have been trying pkgbase for a while but there is one specific topic that's still not very clear to me is how do i go around only inatalling world from src on a pkgbase system

make packages requires you to do both buildworld and buildkernel,it also requires you to setup a local repo using nginx(as far as i can read from the handbook) i tried to do just pkg add * from the /usr/obj/usr/src/repo/FreeBSD:${ABI}.xxxx/xxxx and that obviously messed up my system pretty bad

so i was wondering if there was a way to build packages of only base without having buildkernel as well and if there was a way to install those packages without having to go through setting up a server with nginx and as far as i am aware packageworld target is only for release targets and not for me

Wis...@proton.me

unread,
Mar 25, 2026, 4:51:36 PM (8 days ago) Mar 25
to vermaden, freebsd...@freebsd.org, freebsd-...@freebsd.org
hi, i asked for a method that allows me to install pkgbase world packages without having to buildkernel and make buildkernel and make packages means building kernel, i am not looking for some sort of hack as well

Thank you
-------- Original Message --------
On Thursday, 03/26/26 at 02:09 vermaden <verm...@interia.pl> wrote:
Something like that:

# cd /usr/src
# make -j $( nproc ) buildworld buildkernel
# make packages

This gives You PKGBASE packages here:

/usr/obj/usr/src/repo/FreeBSD:15:amd64/latest

You then create pkg(8) repo there:

# pkg repo /usr/obj/usr/src/repo/FreeBSD:15:amd64/latest
Creating repository in .: 100%
Packing files for repository: 100%

Create pkg(8) repo file.

# cat /etc/pkg/FreeBSD-base.conf
FreeBSD-base: {
url: "file:///usr/obj/usr/src/repo/FreeBSD:15:amd64/latest",
enabled: yes
}

Then create new dir (or mount disks there):

# mkdir -p /NEW
/NEW

... and populate that PKGBASE installation using bsdinstall(8) as follows.

# export BSDINSTALL_CHROOT=/NEW
# export BSDINSTALL_PKG_REPOS_DIR=/usr/obj/usr/src/repo/FreeBSD:15:amd64/latest
# env TERM=xterm bsdinstall pkgbase

After its finished - you have FreeBSD installed using PKGBASE inside /NEW dir.

The 'env TERM=xterm' part is optional - makes sure you start bsdinstall(8) in colors.

Regards,
vermaden






> Hi there, i have been trying pkgbase for a while but
> there is one specific topic that's still not very clear to
> me is how do i go around only installing world from
> src on a pkgbase system
>
> make packages requires you to do both buildworld and
> buildkernel, it also requires you to setup a local repo
> using nginx (as far as i can read from the handbook)
> >i tried to do just pkg add * from the
> /usr/obj/usr/src/repo/FreeBSD:${ABI}.xxxx/xxxx and
> that obviously messed up my system pretty bad
>
> so i was wondering if there was a way to build
> packages of only base without having buildkernel as
> well and if there was a way to install those packages
> without having to go through setting up a server with
> nginx and as far as i am aware package world target

Lexi Winter

unread,
Mar 25, 2026, 5:16:07 PM (8 days ago) Mar 25
to freebsd...@freebsd.org, freebsd-...@freebsd.org
Wis...@proton.me wrote in <UGVbTfxFnLh7zkFaMJrCf_Fll6DjeBxw5VK_kc_jdLlOlJPe6QtfNOQm23v-DOSO-DP1YiEcP8APpn9To22Lc64V-oX24Mor7jSE_ZtYmj8=@proton.me>:
> i have been trying pkgbase for a while but there is one specific topic
> that's still not very clear to me is how do i go around only
> inatalling world from src on a pkgbase system

you build the system from source, then you build a package repository,
then you install packages from the repository.

assuming your src is in /usr/src:

% cd /usr/src
% make buildworld buildkernel update-packages

this builds a package repository in ${REPODIR}, which is by default, i
think, /usr/obj/repo.

to upgrade from this repository, you need a suitable pkg(8) repository
configuration, such as:

base {
url: "file:///usr/obj/repo/${ABI}/latest",
enabled: yes
}

i haven't tested this recently, so the paths there might not be entirely
correct. you will need to disable the 'FreeBSD-base' repository that
bsdinstall creates; the easiest way to do this is to simply rm
/usr/local/etc/pkg/repos/FreeBSD-base.conf.

you should then be able to do 'pkg upgrade' to upgrade from the packages
you built.

> make packages requires you to do both buildworld and buildkernel,

you should use 'make update-packages', not 'make packages'. but yes,
either of those targets require you to build the world first, because
that's what creates the binaries in the packages.

> it also requires you to setup a local repo using nginx(as far as i can
> read from the handbook)

no, it doesn't. if the handbook says that, it's wrong; unfortunately
the documentation for pkgbase is fairly poor right now. but as you can
see from what i said above, it's possible to do this using only local
files, you do not need a web server.

>i tried to do just pkg add * from the
>/usr/obj/usr/src/repo/FreeBSD:${ABI}.xxxx/xxxx and that obviously
>messed up my system pretty bad

that's wrong and you shouldn't do that.

> so i was wondering if there was a way to build packages of only base
> without having buildkernel as well

currently, you have to build both world and kernel to create a package
repository.

> and if there was a way to install those packages without having to go
> through setting up a server with nginx

you do not need to set up nginx for this.

> and as far as i am aware packageworld target is only for release
> targets and not for me

"make packageworld" is nothing to do with pkgbase, despite the name;
it's related to some other, not relevant distribution methods.
signature.asc

Lexi Winter

unread,
Mar 25, 2026, 5:24:28 PM (8 days ago) Mar 25
to freebsd...@freebsd.org, freebsd-...@freebsd.org
vermaden wrote in <ehmytkxaojxlricxcntw@lkvb>:
> > you should use 'make update-packages', not 'make packages'
>
> I was told the same thing - but got hit by that 'recommendation'.
>
> I mean - after these:
>
> # make buildworld buildkernel
>
> When I type:
>
> # make update-packages
>
> It sometimes fails with some strange error.

are you going to tell us the error or do we have to guess?
signature.asc

Lexi Winter

unread,
Mar 25, 2026, 5:56:26 PM (8 days ago) Mar 25
to freebsd...@freebsd.org, freebsd-...@freebsd.org
polyd...@proton.me wrote in <m-cS1PTzow3fGVjDOpYyn6W_o4S1wWeW_rAts1LiWRgqkb4CXug6y8weHusL07G9vt2l5WGX76OF2C-JckHufUvwSqJ4511_3wNZ81QeOz4=@proton.me>:
> is needing to do both buildworld and buildkernel to create a pkg repo
> the intended behaviour or is that planned to change

right now i don't believe there are any plans to change that. i suppose
it might change in the future. usually people want to build both the
world and the kernel, so this isn't an oft-requested feature.

could you elaborate on why you want to build world but not kernel?
this would help inform development efforts in that area.

> additionally may i ask why it's recommended to do 'make
> upodate-packages' over 'make packages'

'update-packages' will copy unchanged packages from the previous build
to the current build, which means if only a small number of packages
have changed, the system won't try to update every package.
signature.asc

Lexi Winter

unread,
Mar 25, 2026, 6:41:58 PM (8 days ago) Mar 25
to freebsd...@freebsd.org, freebsd-...@freebsd.org
vermaden wrote in <nuoumevhhaldotdbxsyk@bxng>:
> It was reported to me by my buddy

okay, your buddy? what you said was:

> I was told the same thing - but got hit by that 'recommendation'.
>
> I mean - after these:
>
> # make buildworld buildkernel
>
> When I type:
>
> # make update-packages
> It sometimes fails with some strange error.

is this you or your buddy?

> and it seems he forgot the 'buildworld' part:

did "your buddy" run "make update-packages" without running buildworld?
this is not intended to work and indeed, will not work. perhaps we
could produce a better error message there.

> # cd /usr/src
> # make buildkernel KERNCONF='GENERIC FIREWALL' update-packages
>
> --> Processing manifest: /usr/obj/usr/src/amd64.amd64/worldstage/set-optional-jail-dbg.ucl
> --> Processing manifest: /usr/obj/usr/src/amd64.amd64/worldstage/set-optional-jail.ucl
> --> Processing manifest: /usr/obj/usr/src/amd64.amd64/worldstage/set-optional.ucl
> --> Processing manifest: /usr/obj/usr/src/amd64.amd64/worldstage/set-tests.ucl
> ==> Checking for new packages (comparing 15.0p4 to 15.0p4)
> ==> Keeping old FreeBSD-acct-15.0p4.pkg
> cp: /usr/obj/usr/src/repo/FreeBSD:15:amd64/15.0p4/FreeBSD-acct-15.0p4.pkg: No such file or directory

that said, i don't really understand this error. can you please share
the full buildworld, buildkernel and update-packages log?
signature.asc

Pat Maddox

unread,
Mar 26, 2026, 3:06:39 PM (7 days ago) Mar 26
to Mark Millard, freebsd...@freebsd.org, freebsd-...@freebsd.org
On Thu, Mar 26, 2026, at 9:52 AM, Mark Millard wrote:
> On 3/26/26 04:30, polyd...@proton.me wrote:
>> On Thursday, March 26th, 2026 at 3:26 AM, Lexi Winter <i...@freebsd.org> wrote:
>>
>>> polyd...@proton.me wrote in <m-cS1PTzow3fGVjDOpYyn6W_o4S1wWeW_rAts1LiWRgqkb4CXug6y8weHusL07G9vt2l5WGX76OF2C-JckHufUvwSqJ4511_3wNZ81QeOz4=@proton.me>:
>>>> is needing to do both buildworld and buildkernel to create a pkg repo
>>>> the intended behaviour or is that planned to change
>>>
>>> right now i don't believe there are any plans to change that. i suppose
>>> it might change in the future. usually people want to build both the
>>> world and the kernel, so this isn't an oft-requested feature.
>>>
>>> could you elaborate on why you want to build world but not kernel?
>>> this would help inform development efforts in that area.
>>>
>> i usually make my own changes to base code to test some things and learn a few others,and most of the time the changes i make touch only world and dont touch kernel at all,so i like to avoid unnecessary compilation of the binaries and things i didn't change and doing only make buildworld and not make buildkernel buildworld is part of that reason
>
> Are you aware of META_MODE for buildworld and buildkernel (with its use
> of filemon.ko)? Its purpose is to keep track of things and so generally
> rebuild what is necessary but avoid rebuilding what is not. For example,
> back to back rebuilds have the second one not taking very long based on
> the lack of changes.

How long is "not very long" in your experience?

Pat

polyd...@proton.me

unread,
Mar 26, 2026, 3:39:26 PM (7 days ago) Mar 26
to Mark Millard, freebsd...@freebsd.org, freebsd-...@freebsd.org, Lexi Winter
yes i am aware of meta mode and i do use it but i usually pull the latest snapshot of the kernel package available instead of updating kernel from src since i don't make my own changes to the kernel, so that means every time i update the src tree via 'git pull' and everytime updating the src tree brings a kernel change, the time spent to compile that is wasted time especially since my machine isn't really powerful

-------- Original Message --------
On Thursday, 03/26/26 at 22:22 Mark Millard <mar...@yahoo.com> wrote:
On 3/26/26 04:30, polyd...@proton.me wrote:
> On Thursday, March 26th, 2026 at 3:26 AM, Lexi Winter <i...@freebsd.org> wrote:
>
>> polyd...@proton.me wrote in <m-cS1PTzow3fGVjDOpYyn6W_o4S1wWeW_rAts1LiWRgqkb4CXug6y8weHusL07G9vt2l5WGX76OF2C-JckHufUvwSqJ4511_3wNZ81QeOz4=@proton.me>:
>>> is needing to do both buildworld and buildkernel to create a pkg repo
>>> the intended behaviour or is that planned to change
>>
>> right now i don't believe there are any plans to change that. i suppose
>> it might change in the future. usually people want to build both the
>> world and the kernel, so this isn't an oft-requested feature.
>>
>> could you elaborate on why you want to build world but not kernel?
>> this would help inform development efforts in that area.
>>
> i usually make my own changes to base code to test some things and learn a few others,and most of the time the changes i make touch only world and dont touch kernel at all,so i like to avoid unnecessary compilation of the binaries and things i didn't change and doing only make buildworld and not make buildkernel buildworld is part of that reason

Are you aware of META_MODE for buildworld and buildkernel (with its use
of filemon.ko)? Its purpose is to keep track of things and so generally
rebuild what is necessary but avoid rebuilding what is not. For example,
back to back rebuilds have the second one not taking very long based on
the lack of changes.

>>> additionally may i ask why it's recommended to do 'make
>>> upodate-packages' over 'make packages'
>>
>> 'update-packages' will copy unchanged packages from the previous build
>> to the current build, which means if only a small number of packages
>> have changed, the system won't try to update every package.
>>
>
>


--
===
Mark Millard
marklmi at yahoo.com


polyd...@proton.me

unread,
Mar 29, 2026, 2:01:51 PM (4 days ago) Mar 29
to Lexi Winter, freebsd...@freebsd.org, freebsd-...@freebsd.org




Sent with Proton Mail secure email.

On Thursday, March 26th, 2026 at 3:26 AM, Lexi Winter <i...@freebsd.org> wrote:

> polyd...@proton.me wrote in <m-cS1PTzow3fGVjDOpYyn6W_o4S1wWeW_rAts1LiWRgqkb4CXug6y8weHusL07G9vt2l5WGX76OF2C-JckHufUvwSqJ4511_3wNZ81QeOz4=@proton.me>:
> > is needing to do both buildworld and buildkernel to create a pkg repo
> > the intended behaviour or is that planned to change
>
> right now i don't believe there are any plans to change that. i suppose
what are your thoughts on the real-update-packages target,it looks it was created for exactly my usecase(b44147bb12450bdf851a519d1cdc85402f89ed1f)
although it seems it has been broken for a while(e4988ba172a84b35abab8ce065f2210dab70f148)

Lexi Winter

unread,
Mar 29, 2026, 2:53:03 PM (4 days ago) Mar 29
to freebsd...@freebsd.org, freebsd-...@freebsd.org
polyd...@proton.me wrote in <yN6SkdEUa-G-hfPE0ha1RAjvUVnZy8-JCy8VkBeqEG9IdQJA3BBdiSV2i-OPnKoNoTuBCyGv80Jy2RulVvzSHg2iageyMo4F01BesHp-vrk=@proton.me>:
> On Thursday, March 26th, 2026 at 3:26 AM, Lexi Winter <i...@freebsd.org> wrote:
> > polyd...@proton.me wrote in <m-cS1PTzow3fGVjDOpYyn6W_o4S1wWeW_rAts1LiWRgqkb4CXug6y8weHusL07G9vt2l5WGX76OF2C-JckHufUvwSqJ4511_3wNZ81QeOz4=@proton.me>:
> > > is needing to do both buildworld and buildkernel to create a pkg repo
> > > the intended behaviour or is that planned to change
> >
> > right now i don't believe there are any plans to change that.

> what are your thoughts on the real-update-packages target,

targets whose names begin with 'real' are generally intended for
internal use by the build system and aren't supported for users.
you might be able to use it for now, but there's a good chance it
might vanish soon since i'm in the process of rewriting a lot of
the pkgbase build system.

my inclination is that the best way to solve this is by adding new
src.conf options, WITHOUT_{KERNEL,WORLD}_PACKAGES, which could be
used on the make(1) command line to build only some packages. this
would not be particularly difficult to do. the alternatively would
be something a more flexible option like SKIP_PACKAGES='kernel';
that might be useful if people want to skip more things, like src
or tests.
signature.asc
Reply all
Reply to author
Forward
0 new messages