27

I want to find out what version of a C library is installed in my system (Ubuntu 12.04). In particular, I'm interested in libnuma. What is the proper way to do it?

cd /usr/lib
ls -l libnuma*
-rw-r--r-- 1 root root 70312 Feb  8  2012 libnuma.a
lrwxrwxrwx 1 root root    12 Feb  8  2012 libnuma.so -> libnuma.so.1
-rw-r--r-- 1 root root 43976 Feb  8  2012 libnuma.so.1
iomartin
  • 389

4 Answers4

29

I would use dpkg -l | grep libnuma1 to get the version.

As an example, I have ran dpkg -l on xterm and you can see that I'm running versoin 278-4 of xterm.

# dpkg -l | grep xterm
ii  lxterminal                            0.1.11-4                           amd64        LXDE terminal emulator
ii  xterm                                 278-4                              amd64        X terminal emulator
Lawrence
  • 4,423
19

You should try

 ldconfig -v | grep libnuma
MariusMatutiae
  • 48,517
  • 12
  • 86
  • 136
2

The file name or contents won't always keep track of the exact version, so you'd typically want to use the packaging system facilities. For Ubuntu, you can either go to packages.ubuntu.com, search for your file, and see what version of the package is in your version of Ubuntu.

Or from the command line, you can first search for the name of the associated package using dpkg -S /usr/lib/libnuma.so.1, which probably returns libnuma1 as the package name. Then run apt-cache showpkg libnuma1 to find the package version. The apt-cache output can be pretty long, but the version should be in the first few lines.

jjlin
  • 16,120
1

You can use pkg-config:

pkg-config --modversion <your lib name>

For example, in my PC,

pkg-config --modversion fmt

will output

9.1.0