Bootstrapping pkg while deliberately avoiding internet connection

It is very difficult to bootstrap pkg in a computer without internet. I cant even find clear documentation about pkg bootstrapping process, file locations etc to do as manually. Internet connnection shouldnt be a core assumption when installing a system. I understand that most of the people here are server administrators and similar, but there are other use cases of the system.
By the way i have all the installation DVD files on the system.
 
Code:
root@hosaka:~ # mount -t cd9660 /dev/md0 /mnt/
root@hosaka:~ # cat /mnt/packages/
FreeBSD:15:amd64/  freebsd:15:x86:64@ repos/
root@hosaka:~ # cat /mnt/packages/repos/FreeBSD_install_cdrom.conf
#
#
# The pkg(8) repository configuration file for the installation DVD.
#

FreeBSD_install_cdrom: {
  url: "file:///dist/packages/${ABI}",
  mirror_type: "none",
  enabled: yes
}

FreeBSD: {
  enabled: no
}

Copy that file to /usr/local/etc/pkg/repos/. If you made a copy of the packages directory on the DVD to somewhere locally you will probably need to adjust the file URL.

I do see a slight discrepancy in it, the FreeBSD repository should be FreeBSD-ports and FreeBSD-ports-kmods on 15.0, you'll need to disable both or else it will keep trying to get files from the internet.

This bit of config will enable a 'FreeBSD_install_cdrom' repository, pointing to the package repository on the DVD. The URL can be a file:// type URL pointing to a local filesystem location, it doesn't have to be http:// or https://.
 
If your system is 14.3, download pkg from https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/Latest/pkg.pkg on a external device, pkg add pkg.pkg on the target machine.

If on 15.0, disc1, dvd1, pkg-* can be found under /usr/freebsd-packages/offline.

If the installation is pkgbase (packages Technology Preview), then it's installed already, otherwise pkg add pkg-* from the local repository.

15.0 bootonly images must dowload pkg form https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/Latest/pkg.pkg.
 
Code:
root@hosaka:~ # mount -t cd9660 /dev/md0 /mnt/
root@hosaka:~ # cat /mnt/packages/
FreeBSD:15:amd64/  freebsd:15:x86:64@ repos/
root@hosaka:~ # cat /mnt/packages/repos/FreeBSD_install_cdrom.conf
#
#
# The pkg(8) repository configuration file for the installation DVD.
#

FreeBSD_install_cdrom: {
  url: "file:///dist/packages/${ABI}",
  mirror_type: "none",
  enabled: yes
}

FreeBSD: {
  enabled: no
}

Copy that file to /usr/local/etc/pkg/repos/. If you made a copy of the packages directory on the DVD to somewhere locally you will probably need to adjust the file URL.

I do see a slight discrepancy in it, the FreeBSD repository should be FreeBSD-ports and FreeBSD-ports-kmods on 15.0, you'll need to disable both or else it will keep trying to get files from the internet.

This bit of config will enable a 'FreeBSD_install_cdrom' repository, pointing to the package repository on the DVD. The URL can be a file:// type URL pointing to a local filesystem location, it doesn't have to be http:// or https://.
That worked. Thanks very much.
 
I remember it being in the handbook at some point in time, but maybe I'm misremembering. I couldn't find it in the current version of the handbook though, it should probably be added.
 
Back
Top