Friday, July 13, 2012

what's value of linux being modular

What's value of linux being modular if it needs so many duplicate and different versions of the same libraries.

I am running debian squeeze which has almost 50% packages from wheezy such as xorg stuff, kernel, drm, mesa and some application software. However, accidentally I found that I've bewildering number of duplicate libraries. It's insane, can't even remove those duplicates as they are  dependencies for a variety of packages. In the normal world a later package should override an older version, but it's different in linux, sadly. Even if I've deborphan and debfoster I see tons of different versions of libraries such as: libavcodec, libavdevice, libavfilter, libavformat, libavutils, libdb, libjpeg, liblzma, libmatroska, libnspr, libntfs, libssl, libswscale, libusb and libx264. Please have a look at the youtube video to know what I mean.



1 comment:

hyperair said...

The number you see appended to the library package name is known as the soversion. This number is bumped every time there is an ABI break in the library. In other words, the same library with a different soversion is considered "binary incompatible."

When there is an ABI break in the library, you cannot just replace the existing library with the new version, as programs compiled against the old library will crash due to missing symbols, or a change in the binary representation of some data structures, which is why the soversion is included in the package name, and depended upon by packages which use it.

Hence, when an ABI break occurs, all programs and libraries linking against the library with the old soversion will have to be rebuilt. In Debian, we call this a library transition, and this occurs every time a library has a soversion bump/ABI break. This may or may not need patching in the source, and so it can take some time before it finishes.

In any release (Etch, Lenny, Squeeze, Wheezy), all transitions must have completed before the release takes place, so you would have only one soversion of the library present in the repository, and all dependent packages would depend on that particular soversion, so no problem there.

Why you are seeing this situation is because you have installed some packages from the older suite (e.g. Squeeze/Stable), and some packages from the newer suite (e.g. Wheezy/Testing). The packages in the older suite are built against the old version of the library, and the packages in the newer suite are built against the new version of the library, and these two versions are binary incompatible. Therefore, in order to support packages from both regions of the archive, you need to have both versions of the library installed.

This situation is considered good -- the alternative would be to force upgrading of all other packages using that library to the newer suite, or force uninstallation of them, because they would crash and be unusable anyway.

Share your thoughts