6

I have /usr/lib32/libstdc++.so.6 library on my Ubuntu system. I would like to know which package brought it there. How to know that?

vico
  • 4,447
  • 20
  • 55
  • 87
  • `libstdc++.so.6` is the C++ standard library - many applications (including those shipped by Ubuntu) depend on it. – Jonas Czech Mar 15 '18 at 14:36

4 Answers4

7

Please run dpkg -S /usr/lib32/libstdc++.so.6

mariaczi
  • 419
  • 2
  • 5
  • as output I got `lib32stdc++6: /usr/lib32/libstdc++.so.6` . Does `lib32stdc++6` is package name? – vico Mar 15 '18 at 13:28
  • Does it possible that `lib32stdc++6` came with another package in my system? If yes, how to know whole hierarchy then? – vico Mar 15 '18 at 13:34
  • Sure, it is the package name. If you not sure, you can check if you have it installed by `dpkg -l | grep lib32stdc++6` – mariaczi Mar 15 '18 at 13:38
  • I don't remember I run command `aptitude install lib32stdc++6` is it possible that this package came with another package? – vico Mar 15 '18 at 13:42
  • It maybe was installed as a dependency of another one. – mariaczi Mar 15 '18 at 13:45
  • Is it possible somehow to know which package took another one as dependency? – vico Mar 15 '18 at 14:24
  • You can look in this file `/var/log/apt/history.log` – mariaczi Mar 15 '18 at 14:57
5

Now that you know which package /usr/lib32/libstdc++.so.6 came from, you can find out which packages depend on lib32stdc++6 by running:

sudo apt-cache rdepends lib32stdc++6

This will give you a list of package(s) that depend/installed lib32stdc++6

stumblebee
  • 2,963
  • 3
  • 16
  • 31
3

Another solution is to use the tool apt-file :

  • Install it using :

    $ sudo apt-get update && sudo apt-get install apt-file
    
  • Update it's database :

    $ sudo apt-file update
    
  • Search for your desired file :

    $ sudo apt-file search /usr/lib32/libstdc++.so.6
    

The result should be :

$ apt-file search /usr/lib32/libstdc++.so.6
lib32stdc++6: /usr/lib32/libstdc++.so.6
lib32stdc++6: /usr/lib32/libstdc++.so.6.0.21
lib32stdc++6: /usr/share/gdb/auto-load/usr/lib32/libstdc++.so.6.0.21-gdb.py
lib32stdc++6-5-dbg: /usr/lib/debug/usr/lib32/libstdc++.so.6.0.21

/usr/lib32/libstdc++.so.6

Which lead us to know that the package which installed should be lib32stdc++6.

Maki
  • 121
  • 7
rebrec
  • 329
  • 1
  • 7
1

You can search it in https://packages.ubuntu.com

For your case will be this link.

Maki
  • 121
  • 7
  • But how to find `libstdc++.so.6` there? – vico Mar 15 '18 at 13:35
  • Check for the 2nd link, that link contains the search I made for you. – Maki Mar 15 '18 at 13:37
  • I see `Package lib32stdc++6` that I suppose contains many files and one of them might be `libstdc++.so.6`. But I don't see that exactly. – vico Mar 15 '18 at 13:45
  • If you go inside the link I shared with you, you will see [this](https://packages.ubuntu.com/xenial/amd64/lib32stdc++6/filelist), that's the prove of the file you are searching for. – Maki Mar 15 '18 at 14:11