-2

I am trying to install a bunch of open source libraries on a CentOS 7 server, and they all form a fairly complicated web of dependencies on each other. I need to make sure that there are no versioning conflicts ("library hell") where, say, LibA depends on LibB v.1.2 but I install LibB v0.9 by mistake.

So I need to:

  1. Figure out what versions of each library I need (so that they all depend on the right versions of each other); and then
  2. Use yum to install the correct versions

And although I'm going to mention specific libraries here in a second, I think this question can be genericized to any scenario where there are interdependencies between yum libraries.

Specifically, I'm looking to install:

  • libpng-dev (PNG library)
  • libjpeg-dev (JPEG library)
  • libtiff-dev (TIFF library)
  • libopencv-dev (OpenCV)

The thing is, OpenCV has dependencies on the first three. So I need to make sure that the version of the PNG, JPEG and TIFF libraries that yum installs for me are also compatible with the versions that OpenCV expects.

Also, for each of those 4 libraries, I'd like to run a command that verifies the exact version that is currently installed on my system.

Any ideas as to where I can get started? Thanks in advance!

smeeb
  • 205
  • yum already resolves what each package is needed based on the package headers themselves. If something is wrong here, you are using loading using mixed repositories, worked outside yum, or compiled and installed some of the libraries manually. In each case, these are problems you'll have to resolve. – mdpc Oct 06 '16 at 01:11
  • Why the downvotes? This question is on topic, is not a dupe, clearly shows research and is an SSCCE. – smeeb Oct 06 '16 at 08:26
  • Not clear as to what I'm asking? I couldn't have spelled it out any clearer; I literally bulleted the two (closely-related) issues that I'm struggling with. – smeeb Oct 06 '16 at 08:27

1 Answers1

1

As I understand it, your question is in two parts:

  1. How do I find what versions of each library is required?
  2. How do I install the correct versions?

To answer (1): yum deplist $PACKAGE will help show what dependencies are required.

[root@centos7 ~]# rpm -qi libopencv-dev
package libopencv-dev is not installed
[root@centos7 ~]# yum deplist libopencv-dev
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: muug.ca
 * extras: mirror.its.sfu.ca
 * updates: mirror.its.sfu.ca
[root@centos7 ~]# rpm -qi expect
package expect is not installed
[root@centos7 ~]# yum deplist expect
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: muug.ca
 * extras: mirror.its.sfu.ca
 * updates: mirror.its.sfu.ca
package: expect.x86_64 5.45-14.el7_1
  dependency: /bin/sh
   provider: bash.x86_64 4.2.46-20.el7_2
  dependency: libc.so.6(GLIBC_2.14)(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libdl.so.2()(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libm.so.6()(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libm.so.6(GLIBC_2.2.5)(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libtcl8.5.so()(64bit)
   provider: tcl.x86_64 1:8.5.13-8.el7
  dependency: libutil.so.1()(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libutil.so.1(GLIBC_2.2.5)(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: rtld(GNU_HASH)
   provider: glibc.x86_64 2.17-106.el7_2.8
   provider: glibc.i686 2.17-106.el7_2.8
[root@centos7 ~]# 

To answer (2), the answers to this question has details on "How can I instruct yum to install a specific version of package X?"

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
  • Thanks @StandardEyre (+1) - I think this gets me 90%+ of the way there; a few followup questions if you don't mind: (1) if I'm reading the output of yum deplist libopencv-dev correctly, it almost looks like OpenCV doesn't have any dependencies?!? Can you confirm? And (2) In that other answer that you referenced, the example given (for installing specific version of a package with yum) was yum --showduplicates list httpd | expand. What is the purpose of piping the output of yum --showduplicates list httpd into expand? Thanks again! – smeeb Oct 06 '16 at 00:55
  • Hello. expand converts TAB into SPACE which can help formatting. mpdc is right;; if you're getting into issues just installing packages, something else is likely off. If it were me, I would make a fresh installation of CentOS 7 with the default yum repositories. I would then install OpenCV. If there was one or more issues with that, I'd come back here with one question (the first question). I'd either edit this question, or come up with a new question. Good luck! – StandardEyre Oct 06 '16 at 16:30