Find out library version

84,776

Solution 1

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

Solution 2

You should try

 ldconfig -v | grep libnuma

Solution 3

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.

Share:
84,776

Related videos on Youtube

iomartin
Author by

iomartin

Updated on September 18, 2022

Comments

  • iomartin
    iomartin over 1 year

    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
    iomartin over 10 years
    even though @jjlin's, approach also work, I like this one better, as it's cleaner and more direct.
  • SuB
    SuB almost 7 years
    This works most of the time but not applicable when you compile and install the library, because dpkg does not care about libs/apps not installed by dpkg
  • FeRD
    FeRD almost 6 years
    While @SuB is correct, the fact is that without a packaging system, there's no way to know what release an individual library was built from, as that information is managed by the packaging system and not contained in the library. The library itself only knows its API version (the number after the .so). When you compile and install a library yourself, it's up to you to keep track of where it came from (which is why packaging systems were created).
  • Sandun
    Sandun about 5 years
    It gives me the output but at the beginning of the output there are these two lines. ldconfig: Can't stat /libx32: No such file or directory . ldconfig: Can't stat /usr/libx32: No such file or directory . Is that something to worry about?
  • igor
    igor over 2 years
    ldconfig -v | grep libnuma shows libnuma.so.1 -> libnuma.so.1.0.0, but dpkg -l | grep libnuma1 shows ii libnuma1:amd64 2.0.12-1. This variant does not look reliable.