# Looking for most efficient way to verify specifically installed libraries



## vpic (Oct 9, 2009)

Hello,
I'm looking to check the current installed libraries of my system against a known pre-requisite list.  For example, I'm finally getting time to try out e17 Window Manager and the kind folks on the Enlightenment dev team have provided this list (http://wiki.enlightenment.org/index.php/E17_User_Guide/Installing_from_Source_Repository) of tools to make sure I have.

I have been using the following algorithm (manually, btw):
1.  Check /usr/ports and search for string of library_name using [font="Courier New"]make search name=<library_name>[/font]

2.  Trying to see if library is already installed using [font="Courier New"]pkg_add -r <library_name>[/font] and checking for either install or package already installed message

3.  Various combinations of [font="Courier New"]pkg_info or pkg_version[/font], but either not getting specific info for <library_name> or getting a message that <libarary_name> doesn't exist (probably because I'm not specifying the version number).

4.  Going to the port master index and string-searching for the <library_name> and then following hyperlinks to read the appropriate descriptions and, essentially, guessing.

I am learning a lot about a lot of commands this way, but I'd just assume figure out something a little more efficient and then script it 

Any suggestions?  Anything as simple as looping the list referenced above into a FreeBSD equivalent of rpm -qa | grep <pkg_name>?

Thanks in advance,
vPic


----------



## crsd (Oct 9, 2009)

uh, something like:

```
pkg_info -Ex <library-name> || pkg_add -r <library-name>
```
?


----------



## vpic (Oct 9, 2009)

Yeah, just like that   Thanks for the quick reply.


----------



## noobster (Oct 9, 2009)

This may be somewhat off topic, but e17 is in the ports tree, although it's not based on the latest snapshot.


----------



## aragon (Oct 10, 2009)

Using ldconfig is the most direct, low level, sure fire way of checking I think.


```
ldconfig -r
```

combined with an awk/sh/python/etc. recipe of your imagination.


----------

