How can I get access to the source code of standard shared libraries?
Asked
Active
Viewed 468 times
1 Answers
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