Offline install of packages with pkg add cannot find dependencies

Hello, grateful for your help.

I have an online FreeBSD 13.1 system, i am fetching packages with dependencies, but cannot install them on another offline system.

pkg fetch -o /root/packages -d xorg

Will download xorg packages and dependencies, and other packages i might choose, to the folder

I copy all the packages from that folder to another FreeBSD 13.1 system (which has no Internet). I run

pkg add xorg-7.7_3.pkg

Which will fail on the offline system, as it cannot find the dependencies even through they are in the folder, I assume because there is no metadata?

Did I not copy something I should have?
 
Which will fail on the offline system, as it cannot find the dependencies even through they are in the folder, I assume because there is no metadata?
It doesn't need that meta data if you install packages this way. The meta data is only for creating an actual repository from the directory.

Can you post an ls -l of that directory and the exact error message?
 
Apologies, this was my fault, during the copy some of the filenames and characters were changed, I re-tried today and this is now working well.

I wondered if there was maybe a better way, like the install ISO package directory which looks like it contains metadata, can I make my own repo with the metadata for the packages and dependencies I have downloaded (but not installed) and what would be the best steps for that. I assume this would allow a pkg install on the offline system

Thanks
 
can I make my own repo with the metadata for the packages and dependencies I have downloaded (but not installed) and what would be the best steps for that.
pkg-repo(8)

I assume this would allow a pkg install on the offline system
It could but you don't have to as you can simply use pkg-add(8) to install them from a local directory. But ideally you have all these packages stored on a central (local) server. You can use something like www/nginx to 'share' that directory on your LAN. Then you would need to use pkg-repo(8) to create the meta data. Configuring a custom repository is as simple as creating a /usr/local/etc/pkg/repos/myrepo.conf:
Code:
myrepo: {
  url: http://mylocal.server.example.com/packages/
}
Note that you can also use file:// URIs to point to a local directory:
Code:
myrepo: {
  url: file:///storage/mypackages/
}
 
Back
Top