In OpenBSD, I have the possibility to take a snapshot with all my installed packages, with

pkg_info -m > output.txt 

and then move this file to a different server and on this new server run a:

pkg_add -lz output.txt 

and all packages will be re-installed. checking the man page from FreeBSD pkg_info and pkg_add I didn't find it. Is there any recipe to do it?

1 Answer 1


To summarize what is written in the manual: use pkg_info to see what you have installed, output that to a file, then you can do something like (assuming you are using bash or a POSIX compliant shell) pkg_add -r $(cat mylist.txt).

  • hi @schaiba. It didn't work as you suggested. Instead I had to remove the version first. The OpenBSD version from pkg_add is smarter. I did something like: pkg_add -r $(cat mylist.txt | cut -f1 -d\-)
    – VP.
    May 10, 2013 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.