Howto find packages

Jez Hancock jez.hancock at munk.nu
Thu Oct 16 09:01:46 PDT 2003


On Thu, Oct 16, 2003 at 04:44:06PM +0100, Matthew Seaman wrote:
> On Thu, Oct 16, 2003 at 07:59:00AM -0700, Dinesh Nadarajah wrote:
> > For eample, in Debian, I can use "apt-cache search mozilla" and this
> > will list all packages with mozilla in it and then I can select the
> > package for installation.
> 
> The emphasis in FreeBSD is generally on ports rather than packages.
> For many ports, downloading the source and compiling doesn't take a
> great deal longer than downloading a binary package.  Of course, for
> some ports compilation takes quite a lot longer.
> 
> You can use the ports tree to search for what ports/packages are
> available:
> 
>     % cd /usr/ports
>     % make search key=foo
>     % make search name=bar
<snip>
I noticed a useful looking port tool here recently:

/ports/Tools/scripts/portsearch

which is a perl script that adds some teeth to the method mentioned by
Matthew above.  I've not actually used it but it looks useful.

Another simple way is to search the INDEX file directly:

grep "^mozilla" /usr/ports/INDEX

to return a list of all ports starting with 'mozilla'.  The list can be
a bit unreadable so if you add:

grep "^mozilla" /usr/ports/INDEX | cut -f1-2 -d"|"

it gives a more readable listing:

mozilla-thunderbird-0.2|/usr/ports/mail/mozilla-thunderbird
mozilla-1.4,2|/usr/ports/www/mozilla
mozilla-1.5b,1|/usr/ports/www/mozilla-devel
mozilla-gtk2-1.5b|/usr/ports/www/mozilla-devel-gtk2
mozilla-embedded-1.4,2|/usr/ports/www/mozilla-embedded
mozilla-embedded-1.5b,1|/usr/ports/www/mozilla-embedded-devel
mozilla-firebird-0.6.1_1|/usr/ports/www/mozilla-firebird
mozilla-gtk2-1.4|/usr/ports/www/mozilla-gtk2
mozilla-headers-1.4,2|/usr/ports/www/mozilla-headers
mozilla-headers-1.5b,1|/usr/ports/www/mozilla-headers-devel
mozilla-fonts-1.0_1|/usr/ports/x11-fonts/mozilla-fonts

where the first field is the port name and the second is the directory
the port resides in.

For some ports you might want to ommit the leading '^'
(especially in the case of perl packages which generally begin with 'p5-').

This is pretty much what the portsearch tool appears to do (with lots of
extra features packed in too)... don't know why I haven't used it yet :=)

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/


More information about the freebsd-questions mailing list