Skip to main content

Having multiple versions of a library in the system is not an issue in most Linux distributions: shared libraries with distinct sonames can coexist within the same /usr/lib directory. Moreover, package managers can be instructed to install several such libraries by specifying correct package names:

apt-get install libjpeg7
apt-get install libjpeg8

In reality you can encounter two flaws with this system:

  1. Most distributions provide only one library version per distribution version to save space. For example, my Debian Wheezy only havehas libjpeg8. You will still be able to install a partricularparticular library version (e.g. libjpeg7) from sources, and it will coexist with other versions without issues. You maycan even try to install a package from another distribution, but beware as it might pull a whole lot of dependencies.

  2. Sometimes two library versions with the same soname (which are meant to be compatible) work with some programs and not with others. That's the main reason to have multiple versions of distributions in the first place, by the way. The solution in this case is to keep incompatible libraries outside /usr/lib and make them accessible to a particular program via LD_LIBRARY_PATH or chroot.

Having multiple versions of a library in the system is not an issue in most Linux distributions: shared libraries with distinct sonames can coexist within the same /usr/lib directory. Moreover, package managers can be instructed to install several such libraries by specifying correct package names:

apt-get install libjpeg7
apt-get install libjpeg8

In reality you can encounter two flaws with this system:

  1. Most distributions provide only one library version per distribution version to save space. For example, my Debian Wheezy only have libjpeg8. You will still be able to install a partricular library version (e.g. libjpeg7) from sources, and it will coexist with other versions without issues. You may even try to install a package from another distribution, but beware as it might pull a whole lot of dependencies.

  2. Sometimes two library versions with the same soname (which are meant to be compatible) work with some programs and not with others. That's the main reason to have multiple versions of distributions in the first place, by the way. The solution in this case is to keep incompatible libraries outside /usr/lib and make them accessible to a particular program via LD_LIBRARY_PATH or chroot.

Having multiple versions of a library in the system is not an issue in most Linux distributions: shared libraries with distinct sonames can coexist within the same /usr/lib directory. Moreover, package managers can be instructed to install several such libraries by specifying correct package names:

apt-get install libjpeg7
apt-get install libjpeg8

In reality you can encounter two flaws with this system:

  1. Most distributions provide only one library version per distribution version to save space. For example, my Debian Wheezy only has libjpeg8. You will still be able to install a particular library version (e.g. libjpeg7) from sources, and it will coexist with other versions without issues. You can even try to install a package from another distribution, but beware as it might pull a whole lot of dependencies.

  2. Sometimes two library versions with the same soname (which are meant to be compatible) work with some programs and not with others. That's the main reason to have multiple versions of distributions in the first place, by the way. The solution in this case is to keep incompatible libraries outside /usr/lib and make them accessible to a particular program via LD_LIBRARY_PATH or chroot.

Source Link
Dmitry Grigoryev
  • 7.4k
  • 2
  • 27
  • 64

Having multiple versions of a library in the system is not an issue in most Linux distributions: shared libraries with distinct sonames can coexist within the same /usr/lib directory. Moreover, package managers can be instructed to install several such libraries by specifying correct package names:

apt-get install libjpeg7
apt-get install libjpeg8

In reality you can encounter two flaws with this system:

  1. Most distributions provide only one library version per distribution version to save space. For example, my Debian Wheezy only have libjpeg8. You will still be able to install a partricular library version (e.g. libjpeg7) from sources, and it will coexist with other versions without issues. You may even try to install a package from another distribution, but beware as it might pull a whole lot of dependencies.

  2. Sometimes two library versions with the same soname (which are meant to be compatible) work with some programs and not with others. That's the main reason to have multiple versions of distributions in the first place, by the way. The solution in this case is to keep incompatible libraries outside /usr/lib and make them accessible to a particular program via LD_LIBRARY_PATH or chroot.