0

How can I get access to the source code of standard shared libraries?

Braiam
  • 69,112
Hja
  • 13

1 Answers1

2

It depends on the concrete library you're looking for.

As an example, let's take a look at /usr/lib/liba52-0.7.4.so (this was simply the first file in my /usr/lib directory).

First, let's find out what package the file belongs to:

$ dpkg -S /usr/lib/liba52-0.7.4.so
liba52-0.7.4: /usr/lib/liba52-0.7.4.so

So now we know that the package name is liba52-0.7.4. To download the source code, use

$ apt-get source liba52-0.7.4

Note: no need to use sudo. The latter command will create a directory a52dec-0.7.4/ in the working directory. This contains the source code.

Malte Skoruppa
  • 13,846
  • 5
  • 58
  • 65