Installing packages without internet

Hello. I have a fresh FreeBSD install, and i want to install everything without internet on the computer. Through external media such as the original installation ISO (that i have on a USB stick), or other external storage media. I repeat that i do not want acces to the internet at this particular computer, at least for the time being. Thanks
 
Stuff all the packages you need on a USB stick and use pkg-add(8) to install them. Hint use FAT32 on the stick because that's the only filesystem you can reliably write with any other OS and read on a "barebones" FreeBSD install.
 
Something like env PACKAGESITE=file:///some/location pkg bootstrap

Alternatively you can simply unpack the pkg package and use the pkg-static inside the archive to install itself (which is basically what pkg(7) does automatically).
 
Through external media such as the original installation ISO (that i have on a USB stick), or other external storage media.
The easiest way to create a package repository for the offline machine is to install from the USB FreeBSD installer stick on the external media a full FreeBSD system, then connect that external device to a machine with internet connection.

It's more complicated to make the installer USB a package repository for the offline machine. First, the file system of an .img installer is write protected, it must be configured rw in /etc/fstab. Next, most likely there is not enough space on the installers file system. If there is free disk space on the USB stick, or growfs(8) the installers file system or create a proper second partition in the free space.

On the installed system, packages can be pkg-fetch(8)'ed for the offline machine, e.g.:

Code:
# pkg fetch -o /packages pkg

# pkg fetch -o /packages  -d  xorg-minimal  xfce
To upgrade the packages of the offline machine is another problem.
 
If I understand correctly (I'm not using installer to install FreeBSD), the install media having (limited amount of) pkg is *-dvd1.iso currently.
So assuming you have this written in memstick or something.
And if the media has a directory having subdirectories
  • All
  • Latest
and files
  • data.pkg
  • data.tzst
  • meta
  • meta.conf
  • packagesite.pkg
  • packagesite.tzst
in it, the directory can be considered as local pkg repository.

If this is true, you can create a pkg repo config file (i.e., custom.conf) in /usr/local/etc/pkg/repos/ which its contents are like below.
Code:
custom: {
    url: "file:///full_path_to_the_directory",
    enabled: yes,
}
In this example, you can install pkgs from there with pkg install -r custom pkg_to_be_installed.
 
Back
Top