Pkg list?

Hello.
How can I print all package names in the system to a text file with a single command.

.... gtkam libreoffice a2ps digikam kmix ......
etc.
Thanks
 
pkg info > /net/all.txt
pkg-info(8) is more tailored toward human interaction. karasamur was looking for pkg-query(8). It is the first example in § EXAMPLES of the manual page:
Bash:
pkg query %n-%v
You probably do not want the version, though (⇒ remove ‑%v). FYI, the standard/distributed /usr/local/etc/pkg.conf defines some useful shortcuts (under ALIAS), for example pkg noauto.​
 
Hi.
I was able to get the list of all packages with the
#pkg query %n>pkglist.txt
command and convert this list into plain text with the "selection/combine lines" option of the "kate" program.
Thank you to those who are interested.
 
Hi.
I was able to get the list of all packages with the
#pkg query %n>pkglist.txt
command and convert this list into plain text with the "selection/combine lines" option of the "kate" program.
Thank you to those who are interested.
That list includes both automatically and explicitly installed packages. What you want is a list of explicitly installed packages as the rest are dependencies and are automatically installed. Use pkg prime-list > pkglist.txt instead.
 
Yes. Unless you want to keep track of every installed package (for security purposes for example), you're better off keeping track of pkg prime-list or pkg prime-origins. Both are aliases for a pkg-query(8):
Code:
prime-list           'query -e '%a = 0' '%n''
prime-origins        'query -e '%a = 0' '%o''
They only show 'non-automatic' installed packages, in other words, packages you installed, not their automatically installed dependencies.

Code:
     %a  Returns 1 if the matched package was automatically installed as a
         dependency of another package, 0 otherwise.  The package can be
         automatically removed via ‘pkg autoremove’ when this flag is set and
         no other package depends on it.

And if you're in a habit of installing, then uninstalling packages, run pkg-autoremove(8) every once in a while. It'll clean up old and unneeded dependencies.
 
Back
Top