Deriving base port/package names

Matthew Seaman matthew at
Fri Apr 8 13:43:15 UTC 2016

On 04/08/16 14:29, Roger Marquis wrote:
> Ronald F. Guilmette wrote:
>> what would be a proper sort of sed command to extract
>> _just_ the port/package names, without the version numbers attached?
> This has changed in the past so may not currently be 100% correct but
> these should work:
>   awk -F'-[0-9]' '{ print $1 }'
> or:
>   sed 's/-[0-9].*$//'
> It's a good question in any case and the answer{,s} should probably be
> added to pkg(8)'s EXAMPLES.

Well, assuming that you have the default FreeBSD pkg repo set up, then:

   pkg rquery -a %n

will give you a list of all the package names in the repo, which will be
pretty close to all the known ports/packages -- there's typically a few
that don't build properly.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-ports mailing list