Reinstalling all pkgs

I want to reinstall all my existing pkgs on a new installation. I can simply create a list of pkgs using pkg info and then use that list as input into pkg install?
 
pkg(8) will need a list. In order to know what it is you want to install. If you already have another FreeBSD install(ed) on another box, and want to copy that (ports) installation. On that box. You can feed pkg the following command. To export a list for pkg to process on the other (new) box:
pkg info -oa | awk -F ' ' '{ print $2 }' >>./PKG-LIST

HTH!

--Chris
 
You probably want to install the "primary" packages, and leave the dependencies as is; pkg prime-list should be enough. You probably don't want to force installation of dependency packages as they wouldn't be removed with pkg-autoremove(8) when you decide to remove a primary package.
 
Creative command but it can be done easier: pkg info -qoa > PKG-LIST.

I've put that command line in my list of handy tips.

Now, if I want to reinstall those pkgs, is there any way of removing the ones that are dependencies that would get pulled in anyway?ie. should I pre-process that before doing a pkg install from a list?
 
Lots of useful info here. Just wondering where people come up with this...

pkg() does not mention pkg prime-list or pkg leaf and I can't see any mention of parameters available to pkg info
 
Lots of useful info here. Just wondering where people come up with this...

pkg() does not mention pkg prime-list or pkg leaf and I can't see any mention of parameters available to pkg info

Read pkg-alias(8) man page for further details.
Code:
% pkg alias prime-list
prime-list           'query -e '%a = 0' '%n''
% pkg alias leaf
leaf                 'query -e '%#r == 0' '%n-%v''
 
Back
Top