Solved pkg install from list

I built a light weight desktop from binary packages on an amd64 system. I would like to build the same desktop in an i386 system. Is there a way to install from a list that I generate on the amd64 machine? OpenBSD has a pkg_add -l command but my forum search/web search came up empty for FreeBSD.

I'm comfortable with pkg list > pkglist.txt but was also wondering if I could just list packages that were explicitly installed and not clutter the list with packages that were installed as dependencies?
 
You can feed the output of pkg info -ao | awk '{print $2}' to pkg install. If you have portmaster installed, /usr/local/sbin/portmaster --list-origins does the same, but it only gives you the root/leaf ports. The dependencies will be resolved and retrieved by pkg install.
 
The output of pkg info will generate the list of files, and pkg install accepts a list as input. Might be useful to list packages by origin:
pkg info -a -o -q
 
Thanks. I successfully generated a list of root/leaf ports on the amd64 machine which I redirected into a text file. I transported the file list to my home directory on the new i386 machine but am having trouble. pkg install is taking FBSD_package_list.txt literally and telling me that package FBSD_package_list.txt does not exist. I tried redirecting the output of the list with > and pipe. Without going into a lot of detail, my shell skills are weak.
 
I first removed the package category from the list, ie x11-wm/openbox -> openbox. Additionally, all the listed packages have to be extant in the repository and the -y flag has to be passed to pkg install.
cat FBSD_package_list.txt | xargs pkg install -y. Now I can do some chores instead installing packages piecemeal:)
 
Back
Top