Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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).

share|improve this answer
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 '13 at 9:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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