It is perfectly possible to install multiple versions of a library in Debian. Pinning is the way to go. In this case I decided to obtain libgstreamer0.10
from Debian Unstable (running Debian Testing myself).
Create the file /etc/apt/sources.list.d/unstable.list
with contents:
deb http://ftp.nl.debian.org/debian/ unstable main
deb-src http://ftp.nl.debian.org/debian/ unstable main
Then, create /etc/apt/preferences.d/unstable
with contents:
Package: *
Pin: release a=unstable
Pin-Priority: 200
Now run apt-get update
. To check if everything went ok, type apt-cache policy libgstreamer0.10-0
. It should report something like:
libgstreamer0.10-0:
Installed: (none)
Candidate: 0.10.36-1.5
Version table:
0.10.36-1.5 50
200 http://ftp.nl.debian.org/debian unstable/main amd64 Packages
100 /var/lib/dpkg/status
Note that this adds all packages from unstable with a lower priority. It is also possible to single out one or a few packages. See the documentation on pinning for more details.
PS For me the reason to do this was solving an RStudio dependency on libgstreamer-0.10
: "rstudio: error while loading shared libraries: libgstreamer-0.10.so.0: cannot open shared object file: No such file or directory" (added these details so others may find this after a search).
PPS The link given by @jofel (partly) answers the why part of your question.