- Use a
memstick.imgfile to write a FreeBSD installer to a memory stick - boot from the stick in single user mode
/bin/csh- use gpart(8) to resize things
growfs /mount -uw /- assuming vt(4)
setenv TERM xterm-clearbsdconfig vt_keymap- select, and continue with, a keymap that matches your keyboard layout
reboot -r- live system
- login as root, no password
mount -uw /bsdconfig networking- get an Internet connection – for example, enable DHCP for a network interface
- assuming root-on-ZFS
zpool import- note the name of the pool that you want to import – for example, damp
zpool import -R /tmp/altroot dampzpool get bootfs damp- note the value – for example, damp/ROOT/test
zfs mount damp/ROOT/testpkg bootstrap- add a minimal FreeBSD-base repository configuration to
/etc/pkg/FreeBSD.conf– urlhttps://pkg.freebsd.org/FreeBSD:14:amd64/base_release_3 pkg --rootdir /tmp/altroot install --repository FreeBSD-base FreeBSD-certctl FreeBSD-pkg-bootstrap FreeBSD-utilitieschroot /tmp/altrootcd /rootfetch https://tinyurl.com/pkgbasify-foundation -o ./pkgbasify.luachmod +x ./pkgbasify.luamkdir -p /var/db/etcupdate/current./pkgbasify.lua
Last active
October 5, 2025 10:55
-
-
Save grahamperrin/9570092c127bd43777961b6f016e75ba to your computer and use it in GitHub Desktop.
Using pkgbasify to repair a broken installation of FreeBSD 14.3-RELEASE
Author
Author
bsdinstall keymap
Alternatively, whilst in single user mode, for me:
sysrc keymap="uk.kbd"
- works for live system but not for shell
- non-documented
bsdinstall startbsdinstallapparently returns from the live system, to the FreeBSD installer welcome dialogue, however:
Author
Author
fetch…-o ./pkgbasify.luachmod +x ./pkgbasify.lua
For simplicity, expect pkgbasify to be packaged:
Author
Repairing an installation of 15.0
Simpler. The FreeBSD-base repo is preconfigured, and pkg is already bootstrapped.
Instead of FreeBSD-certctl, install FreeBSD-caroot.
Tested: FreeBSD-15.0-PRERELEASE-amd64-20250822-027be99b1f33-279771-memstick.img
Author
Backlinks:
- https://mail-archive.freebsd.org/cgi/mid.cgi?18e1a7e9-07d8-43a2-96af-0acdab6c2920 | https://lists.freebsd.org/archives/freebsd-pkgbase/2025-August/000763.html
- https://www.reddit.com/user/grahamperrin/comments/1msyzfe/using_pkgbasify_to_repair_a_broken_installation/
- https://mastodon.bsd.cafe/@grahamperrin/115041689025019258
- https://www.reddit.com/r/freebsd/comments/1mzlfq0/comment/napu18b/?context=1
- https://www.mail-archive.com/[email protected]/index.html#192714 | https://mail-archive.freebsd.org/cgi/mid.cgi?babf662e-cded-4a2c-b5e8-c5a7175739f2 | https://lists.freebsd.org/archives/freebsd-current/2025-September/008672.html
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289414#c2
- https://www.reddit.com/r/freebsd/comments/1ngrjc8/comment/ne67eaz/
- https://mail-archive.freebsd.org/cgi/mid.cgi?9f2cd23d-b0d9-4e3f-940a-7052282347e2 | https://lists.freebsd.org/archives/freebsd-current/2025-October/009023.html
- https://mail-archive.freebsd.org/cgi/mid.cgi?6799596f-7606-4869-a44e-17935ce0b433 | https://lists.freebsd.org/archives/freebsd-pkgbase/2025-October/000961.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Origin:
Notes:
pkgbasify.luais not official/var/db/etcupdatefeatures in FreeBSD bug 288295 – bsdinstall does not bootstrap etcupdate database for pkgbase installationsFreeBSD-pkg-bootstrappackage.Tested with:
FreeBSD-14.3-STABLE-amd64-20250814-7b9f6ebb9268-272178-mini-memstick.imgfrom https://download.freebsd.org/snapshots/ISO-IMAGES/14.3/Special thanks to: