LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-08-2008, 05:39 PM   #1
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Rep: Reputation: 30
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.
 
Old 07-08-2008, 05:47 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,498

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Code:
/sbin/ldconfig -p
should give most of them. Also have a look at man pkg-config.

Last edited by colucix; 07-08-2008 at 05:59 PM.
 
Old 07-08-2008, 06:09 PM   #3
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
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?
 
Old 07-08-2008, 09:52 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,498

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Quote:
Originally Posted by newtovanilla View Post
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.
 
Old 07-18-2008, 04:49 PM   #5
lifeforce4
Member
 
Registered: May 2003
Location: 2:16:840
Distribution: Slackware, CentOS, RedHat, Xubuntu
Posts: 169
Blog Entries: 1

Rep: Reputation: 32
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

Last edited by lifeforce4; 07-19-2008 at 07:05 AM. Reason: command syntax
 
1 members found this post helpful.
  


Reply

Tags
library


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
?? Command to list installed libraries. polarbear20000 Slackware 4 02-21-2008 04:42 PM
command to list installed applications csy2329 Solaris / OpenSolaris 6 05-12-2006 07:55 PM
command to list rpm already installed? ginda Linux - Newbie 2 03-09-2005 06:25 AM
Bash script: add all numbers from command output wi-Z-art Programming 2 08-06-2003 09:16 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration