Copying pkgs from one system to another

What is the simplest way of copying pkgs from one system to another?

I guess I can get a list from one system and subsequently pipe that list into pkg install on the other system using

cat pkg-listfile | xargs pkg install -y

Not sure how to get that list in the first place.... maybe pkg prime-list > pkg-listfile ....

Does that sound right?
 
If you find this and have lots of packages read the manual page for xargs and do this:
On the source:
pkg query %o >pkg-listfile
Transfer this file to the destination and then
cat pkg-listfile | xargs -n1 pkg install -y
Otherwise the number of arguments to pkg-install can overwhelm the shell buffer. I had 721 packages.
 
Back
Top