0

I have the libpng rpm package installed on Centos linux which includes:

/usr/lib64/libpng.so.3.49.0
/usr/lib64/libpng.so.3 #softlink to libpng.so.3.49.0

I use software that uses:

/usr/lib64/libpng.so

Is it better to install the libpng-devel package which creates the /usr/lib64/libpng.so softlink such that this softlink will get updated when the libpng package gets updated? (I don't need to actually compile anything so I only need the soft link.)

Or is it better to manually create the softlink knowing that if the libpng package eventually gets updated the softlink won't work and may need to be recreated?

Or is their another way besides these first two ways that should be used instead?

abalone
  • 211
  • 1
  • 2
  • 5

2 Answers2

1

In this case, I would actually choose a third way: Create a lib/ directory somewhere, put the symlink there, and export LD_LIBRARY_PATH pointing to the created directory (preferably modify the start script of the program, or create one if it doesn't exist). This way, when the program starts, it will look for shared libraries there first, and will find libpng.so. This is a little hack-ish solution, less so if the software you use has a dedicated directory, in which case you can put the symlink where it belongs.

Devel packages tend to install a whole lot of clutter, if you don't want to actually compile anything, it is needless to install them.

Lacek
  • 7,233
  • 24
  • 28
  • And what happens when the package gets updated such that the symlink is no longer valid? That will cause the software to break until a new symlink is manually created, right? – abalone Apr 21 '16 at 14:50
  • Yes, then the software will break. However, I think it will be a long time till the libpng.so.3 symlink itself becomes obsolete and gets deleted by an upgrade. – Lacek Apr 25 '16 at 11:42
0

I would recommend installing the libpng-devel package.

  1. you also need the header files!
  2. if you install the library using an rpm; then why not install the .so using an rpm; better keep both up to date with each other.
Chris Maes
  • 570
  • 2
  • 9
  • I agree it's good that the symlink will be automatically updated, but I don't need the header files, as noted in the answer by lacek, "Devel packages tend to install a whole lot of clutter, if you don't want to actually compile anything, it is needless to install them." – abalone Apr 21 '16 at 14:52