LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bash command to list installed libraries and version numbers (https://www.linuxquestions.org/questions/linux-newbie-8/bash-command-to-list-installed-libraries-and-version-numbers-654413/)

newtovanilla 07-08-2008 06:39 PM

Bash command to list installed libraries and version numbers
 
Ubuntu, x86_64

What is the Bash command to list the libraries and their versions? I am trying to build an application, and I want to see that I have the right libraries installed, but do not know how to do that. I tried to Google it, but did not have a better search to use than "library command" and could not find the answer.

colucix 07-08-2008 06:47 PM

Code:

/sbin/ldconfig -p
should give most of them. Also have a look at man pkg-config.

newtovanilla 07-08-2008 07:09 PM

Thanks, the command "ldconfig -p" gives the names of the libraries, and the "pkg-config --modversion" command can give the version. When I try to use autocomplete with "pkg-config --modversion lib" then I only see four libraries to choose from. Does pkg-config only see a handful of libraries?

colucix 07-08-2008 10:52 PM

Quote:

Originally Posted by newtovanilla (Post 3208133)
When I try to use autocomplete with "pkg-config --modversion lib" then I only see four libraries to choose from. Does pkg-config only see a handful of
libraries?

pkg-config retrieves its data from a bunch of metafiles which are installed along with the major part of (if not all) the libraries packages. These files are usually under /usr/lib/pkgconfig or in the directories specified by the environmental variable PKG_CONFIG_PATH.

Regarding the autocompletion issue, you will see only the files and directories whose name begins with "lib" in the current directory. You cannot use the autocompletion to have a list of all the installed libraries.

lifeforce4 07-18-2008 05:49 PM

After searching Google I also ended up fining this link it was some what helpful with the ldconfig -p command but it did not show the versions of the libraries. Is there a way to list the versions? I am running slackware and my libraries were not installed by pkgs.

Thanks,
Kyle

If you use the ldconfig -v it will show the libraries versions. Use grep to find a specific library by name.
Code:

#ldconfig -v
#ldconfig -v | grep libname



All times are GMT -5. The time now is 10:01 PM.