how get "/var/db/pkg"?

Robert Huff roberthuff at rcn.com
Wed May 3 15:56:37 UTC 2006


Tom Grove writes:
>  If you haven't run locate since you delete /var/db/pkg you could run:
>  
>  locate "/var/db/pkg"
>  
>  This will at least give you a partial (maybe a full) listing of 
>  everything you have installed.  From there you could do a script that 
>  does something like:
>  
>  for $program in <fileofpackagenames>
>      pkg_delete $program
>      pkg_add $program
>  
>  Just a thought....

	Try:

	locate "/var/db/pkg" | awk '{FS = "\/\\+.*$"} {print $1}' | \
		awk '{FS = "/$"} {print $1}' | sort -u 

	This will reduce the output to one line per package.


						Robert Huff



More information about the freebsd-questions mailing list