Bug 293516 - freebsd-update without pkg(8) is largely unusable in FreeBSD 14.4-RELEASE
Summary: freebsd-update without pkg(8) is largely unusable in FreeBSD 14.4-RELEASE
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.4-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2026-03-01 02:05 UTC by Graham Perrin
Modified: 2026-03-09 16:57 UTC (History)
1 user (show)

See Also:


Attachments
Screenshot: VirtualBox, taking a snapshot. pkg is not installed. The third run of 'freebsd-update install' is endless. (84.81 KB, image/png)
2026-03-01 02:05 UTC, Graham Perrin
no flags Details
Screenshot: an apparently endless run of freebsd-update fetch (150.70 KB, image/png)
2026-03-01 03:38 UTC, Graham Perrin
no flags Details
top at ttyv2, whilst still awaiting a response to the fetch command at ttyv1 (69.41 KB, image/png)
2026-03-01 03:41 UTC, Graham Perrin
no flags Details
Screenshot: in a different virtual machine, another apparently endless run of freebsd-update fetch (248.01 KB, image/png)
2026-03-01 05:19 UTC, Graham Perrin
no flags Details
typescript (667.01 KB, text/plain)
2026-03-01 10:01 UTC, Graham Perrin
no flags Details
freebsd-update fetch after upgrading 14.3-RELEASE-p9 userland (51.39 KB, image/png)
2026-03-01 20:31 UTC, Graham Perrin
no flags Details
typescript (2.73 KB, text/plain)
2026-03-04 22:38 UTC, Graham Perrin
no flags Details
Screenshot: ARM64, freebsd-update fetch before and after bootstrapping pkg (125.11 KB, image/png)
2026-03-06 07:46 UTC, Graham Perrin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin 2026-03-01 02:05:05 UTC
Created attachment 268437 [details]
Screenshot: VirtualBox, taking a snapshot. pkg is not installed. The third run of 'freebsd-update install' is endless.

Script started on Sun Mar  1 01:15:20 2026
root@bug293502:~ # uptime

 1:15AM  up 42 secs, 1 user, load averages: 0.24, 0.06, 0.02
root@bug293502:~ # echo $SHELL

/bin/csh
root@bug293502:~ # freebsd-version -kru ; uname -a

14.4-RC1
14.4-RC1
13.5-RELEASE-p10
FreeBSD bug293502 14.4-RC1 FreeBSD 14.4-RC1 releng/14.4-n273674-041aa28386d3 GENERIC amd64
root@bug293502:~ # freebsd-update install

src component not installed, skipped
Creating snapshot of existing boot environment... done.
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run
'freebsd-update [options] install' again to finish installing updates.
root@bug293502:~ # pkg leaf

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: n
root@bug293502:~ # freebsd-update install

load: 0.14  cmd: pkg 44102 [ttyin] 469.14r 0.00u 0.00s 0% 8212k
load: 0.05  cmd: pkg 44102 [ttyin] 618.15r 0.00u 0.00s 0% 8212k
load: 0.10  cmd: pkg 44102 [ttyin] 1832.80r 0.00u 0.00s 0% 8212k
load: 0.31  cmd: pkg 44102 [ttyin] 2151.43r 0.00u 0.00s 0% 8212k
^C

root@bug293502:~ # exit

exit

Script done on Sun Mar  1 01:58:26 2026
Comment 1 Graham Perrin 2026-03-01 03:38:06 UTC
Created attachment 268440 [details]
Screenshot: an apparently endless run of freebsd-update fetch

I restored the VirtualBox snapshot (named 'pkg is not installed. The third run of 'freebsd-update install' is endless.').

I cancelled the install command, waited for the time to correct itself, then ran the fetch command for more seventy minutes.  

More specifically: 

date ; uptime ; /usr/bin/time -h freebsd-update fetch

In response: nothing.
Comment 2 Graham Perrin 2026-03-01 03:41:04 UTC
Created attachment 268441 [details]
top at ttyv2, whilst still awaiting a response to the fetch command at ttyv1
Comment 3 Graham Perrin 2026-03-01 05:19:42 UTC
Created attachment 268444 [details]
Screenshot: in a different virtual machine, another apparently endless run of freebsd-update fetch

Reproducible in a different virtual machine. For this test, I used Virtual Machine Manager and QEMU. 

In this case, I ignored the hint for a third run of the install command. Instead: 

date ; freebsd-update fetch

I took this screenshot after waiting for five minutes. 

Ten minutes later: still nothing.
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2026-03-01 09:26:44 UTC
Re: comment 3

After a few hours: 

- I cancelled the fetch command
- I attempted the install command. 

Re: <https://github.com/freebsd/freebsd-src/blob/6da9d465c54bf2e3496e83db025c5d22f3b3cc17/usr.sbin/freebsd-update/freebsd-update.sh#L33> and <https://github.com/freebsd/freebsd-src/blob/6da9d465c54bf2e3496e83db025c5d22f3b3cc17/usr.sbin/freebsd-update/freebsd-update.sh#L339-L344> I experimented with: 

    --debug

    the VERBOSELEVEL environment variable. 

Nothing gained, unfortunately. 

In the absence of logging (bug 256143), I'm experimenting without truly understanding the code.

"load …" lines in previous comments, and below, are from SIGINFO (Control-T). 

----

Script started on Sun Mar  1 04:45:49 2026
root@bug293516:~ # echo $SHELL

/bin/csh
root@bug293516:~ # uptime

 4:45AM  up 1 min, 1 user, load averages: 0.22, 0.07, 0.02
root@bug293516:~ # bectl list -c creation

BE                                 Active Mountpoint Space Created
default                            NR     /          2.75G 2026-03-01 04:06
13.5-RELEASE_2026-03-01_041835     -      -          246M  2026-03-01 04:18
13.5-RELEASE-p10_2026-03-01_044342 -      -          1.88M 2026-03-01 04:43
root@bug293516:~ # freebsd-version -kru

14.4-RC1
14.4-RC1
13.5-RELEASE-p10
root@bug293516:~ # pkg leaf

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: n
root@bug293516:~ # freebsd-update install

src component not installed, skipped
Creating snapshot of existing boot environment... done.
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run
'freebsd-update [options] install' again to finish installing updates.
root@bug293516:~ # date ; freebsd-update fetch

Sun Mar  1 05:04:10 GMT 2026
load: 0.19  cmd: pkg 44149 [ttyin] 13993.27r 0.00u 0.00s 0% 8204k
^^C^C

root@bug293516:~ # date

Sun Mar  1 08:57:36 GMT 2026
root@bug293516:~ # freebsd-update --debug install

load: 0.08  cmd: pkg 44890 [ttyin] 102.80r 0.00u 0.00s 0% 8228k
^C

root@bug293516:~ # setenv VERBOSELEVEL debug

root@bug293516:~ # date

Sun Mar  1 09:00:56 GMT 2026
root@bug293516:~ # 

root@bug293516:~ # freebsd-update install

load: 0.16  cmd: pkg 45139 [ttyin] 151.24r 0.00u 0.00s 0% 8228k
^C

root@bug293516:~ # date

Sun Mar  1 09:03:53 GMT 2026
root@bug293516:~ # exit

exit

Script done on Sun Mar  1 09:04:03 2026
Comment 5 Graham Perrin 2026-03-01 10:01:14 UTC
Created attachment 268447 [details]
typescript

Re: comment 4

A workaround, condensed: 

1. pkgbasify
2. pkg-unregister(8)

Afterwards: 

root@bug293516:~ # freebsd-update fetch

src component not installed, skipped
You have a partially completed upgrade pending
Run 'freebsd-update [options] install' first.
Run 'freebsd-update [options] fetch -F' to proceed anyway.
root@bug293516:~ # freebsd-update install

src component not installed, skipped
Creating snapshot of existing boot environment... done.
Installing updates... done.
root@bug293516:~ # 

----

The tail of the attached typescript file: 

    34	9:30	fetch -o pkgbasify.lua https://tinyurl.com/pkgbasify-foundation
    35	9:30	chmod +x ./pkgbasify.lua
    36	9:30	./pkgbasify.lua
    37	9:36	ee .cshrc
    38	9:37	pkg unregister FreeBSD-\*
    39	9:38	uname
    40	9:38	date
    41	9:38	freebsd-update fetch
    42	9:40	pkg which /usr/bin/uname
    43	9:40	pkg leaf
    44	9:41	pkg unregister -f FreeBSD-clibs FreeBSD-runtime
    45	9:41	freebsd-update fetch
    46	9:42	freebsd-update install
    47	9:42	date
    48	9:42	freebsd-version -kru
    49	9:42	history
root@bug293516:~ # exit

exit
Comment 6 Graham Perrin 2026-03-01 20:25:50 UTC
Also bugged, if I'm not mistaken, upgrades from: 

- EoL 14.2-RELEASE-p7
- 14.3-RELEASE-p9

I'll attach a screenshot of 
    freebsd-update fetch
running endlessly, with nothing printed to the screen, 
following a second and final run of 
    freebsd-update install 
with no hint to perform a third run.
Comment 7 Graham Perrin 2026-03-01 20:31:39 UTC
Created attachment 268461 [details]
freebsd-update fetch after upgrading 14.3-RELEASE-p9 userland

Re: comment 6, here's the screenshot.
Comment 8 Graham Perrin 2026-03-04 22:38:38 UTC
Created attachment 268548 [details]
typescript

Re: comment 5

A more focused workaround: 

1. add the FreeBSD-utilities package, which includes
   /usr/sbin/freebsd-update

2. unregister the package.
Comment 9 Graham Perrin 2026-03-06 03:15:50 UTC
Maybe the bug bites only when pkg is not bootstrapped. 


Script started on Sun Mar  1 19:17:35 2026
root@bug293516-virtualbox:~ # echo $SHELL

/bin/tcsh
root@bug293516-virtualbox:~ # freebsd-version -kru ; uname -mvKU

14.4-RC1
14.4-RC1
14.4-RC1
FreeBSD 14.4-RC1 releng/14.4-n273674-041aa28386d3 GENERIC amd64 1404000 1404000
root@bug293516-virtualbox:~ # /usr/bin/time -h freebsd-update fetch

load: 0.21  cmd: pkg 1864 [ttyin] 32.41r 0.00u 0.00s 0% 6288k
	32.60s real		0.00s user		0.00s sys
^Ctime: command terminated abnormally
	34.74s real		0.07s user		0.15s sys


root@bug293516-virtualbox:~ # pkg

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:14:amd64/base_4, please wait...
pkg: Attempted to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/base_4/Latest/pkg.pkg
pkg: Attempted to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/base_4/Latest/pkg.txz
pkg: Error: Not Found
A pre-built version of pkg could not be found for your system.
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-2.5.1...
Extracting pkg-2.5.1:   0%
…
Extracting pkg-2.5.1: 100%
pkg: not enough arguments
Usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>|-r <rootdir>] [-C <configuration file>] [-R <repo config dir>] [-o var=value] [-4|-6] <command> [<args>]

For more information on available commands and options see 'pkg help'.
root@bug293516-virtualbox:~ # freebsd-update fetch

src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 14.4-RC1 from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 14.4-RC1-p0.

WARNING: FreeBSD 14.4-RC1 is approaching its End-of-Life date.
It is strongly recommended that you upgrade to a newer
release within the next 3 weeks.
root@bug293516-virtualbox:~ # exit

exit

Script done on Sun Mar  1 19:19:23 2026
Comment 10 Graham Perrin 2026-03-06 07:46:39 UTC
Created attachment 268565 [details]
Screenshot: ARM64, freebsd-update fetch before and after bootstrapping pkg

Re: comment 9

> Maybe the bug bites only when pkg is not bootstrapped. 

The bootstrap workaround is also effective on ARM64.

freebsd-update fetch: 

*     did work without pkg(8) in 14.3-RELEASE-p9
* did not work without pkg(8) in 14.4-RC1.
Comment 11 Graham Perrin 2026-03-06 23:20:41 UTC
Reproducible with FreeBSD-14.4-RELEASE-amd64-disc1.iso

No response to: 

freebsd-update showconfig
Comment 12 Colin Percival freebsd_committer freebsd_triage 2026-03-09 04:51:21 UTC
Is this only on pkgbase systems?
Comment 13 Graham Perrin 2026-03-09 06:29:45 UTC
Re: comment 12

Probably the opposite. 

As far as I can tell: pkgbase systems are never bugged, because pkg(8) is bootstrapped.

----

Comment 11 may be the best indicator, I was probably too terse. 

More explicit steps to reproduce, with the fetch command:

1. install, and have an Internet connection
2. make final changes when exiting FreeBSD Installer
3. freebsd-update fetch

Alternatively: 

1. install
2. restart the OS ("Reboot") after exiting FreeBSD Installer
3. login as root
4. have an Internet connection
5. freebsd-update fetch

Either way, nothing happens. 

With the showconfig command, which shows nothing, an Internet connection is not required :-)
Comment 14 Graham Perrin 2026-03-09 06:36:23 UTC
You might very quickly reproduce the issue on a 14.4-RELEASE system that is _not_ bugged: 

pkg delete -fqy pkg && freebsd-update showconfig

Key Control-C, or Control-T, when boredom or curiosity begins …
Comment 15 Colin Percival freebsd_committer freebsd_triage 2026-03-09 16:15:15 UTC
Ok, there's something weird going on here, because EC2 instances freebsd-update just find when they boot:

freebsd-update 1197 - - src component not installed, skipped
freebsd-update 1197 - - Looking up aws.update.FreeBSD.org mirrors... 1 mirrors found.
freebsd-update 1197 - - Fetching public key from dualstack.aws.update.freebsd.org... done.
freebsd-update 1197 - - Fetching metadata signature for 14.4-RELEASE from dualstack.aws.update.freebsd.org... done.
freebsd-update 1197 - - Fetching metadata index... done.
freebsd-update 1197 - - Fetching 1 metadata files... done.
freebsd-update 1197 - - Inspecting system... done.
freebsd-update 1197 - - Preparing to download files... done.
freebsd-update 1197 - - 
freebsd-update 1197 - - No updates needed to update system to 14.4-RELEASE-p0.
Comment 16 Graham Perrin 2026-03-09 16:35:39 UTC
> EC2 instances

Is pkg bootstrapped on those instances?
Comment 17 Colin Percival freebsd_committer freebsd_triage 2026-03-09 16:57:26 UTC
Oh, actually yes, kind of.  It isn't, but it gets installed before freebsd-update runs.