Yeah, the point of linking to a .so (shared object) library version with a
link that has the major version number without the minor version number is
so that you can upgrade to library versions with newer minor version
numbers that are still compatible with old versions (bug fix upgrades)
without recompiling all of the software that calls functions from those
libraries.
I.e., I have in /lib libvga.so.1.2.8. I have a link to it
ln -s /lib/libvga.so.1.2.8 libvga.so.1
"1" is the major version and "2.8" is the minor version. Software compiled
to use that library will be compiled to look for libvga.so.1. If I upgrade
to version libvga.so.1.2.10, I just copy the new lib into /lib, rewrite
the link, and then delete the old version.
cp libvga.so.1.2.10 /lib [this usually gets done by "make install"]
cd /lib
ln -sf libvga.so.1.2.10 libvga.so.1 [you don't need the dir prefix
when making a link in the current
dir to a file also in the current
dir]
Now my link points to the new version, which has the same functions as the
old version, just faster and less buggy (in theory). Software compiled to
use this shared library still finds functions via "libvga.so.1" without
recompiling.
mkdir ./oldvga;mv libvga.so.1.2.8 ./oldvga [just in case]
If no problems crop up in a few months, i.e. the backup of the old version
is no longer needed,
rm -r /lib/oldvga
If you compile libc and do a "make install", you'll notice that it makes a
backup (at least 4.6.x did) dir as a subdir of /lib (/lib/backup), and
make install puts a copy of your old versions of updated .so libs in there
before installing the new ones and making new links. You may find copies
in /tmp after compiling and installing libc as well, though these are
usually copies of the new ones that you just compiled.
This same process applies to .so libraries in /usr/lib, /usr/local/lib,
/usr/X11R6/lib, and so on. Software finds shared library functions via
the link name, which ends in the major version number of the library. It
is also useful to make a link to X11R6:
ln -s /usr/X11R6 /usr/X11
Then you can reference X11 dirs with a short name in environment variables
in /etc/profile or in ~/.bash_profile:
export PATH="$PATH:/usr/X11/bin" [$VARNAME: means
"append to old value"]
export MANPATH="$MANPATH:/usr/X11/man"
and if you upgrade to X11R7 at some point, all of your path specifications
for PATH and MANPATH in profile and in user shell .rc files don't have to
be changed from "X11R6" to "X11R7". It also is handier to type
ls /usr/X11/lib/X11/app-defaults
than it is to type
ls /usr/X11R6/lib/X11/app-defaults
(the second "/X11" is always there without release number)