Monday, October 31, 2016

Oracle Linux - resolve dependency hell

Whenever you worked with a system that is not connected to a YUM repository you will know that installing software sometimes might result in something known as dependency hell. You want to install a single package however when you try to install the RPM file manually it tells you that you are missing dependencies. As soon as you have downloaded those they will tell you that they have dependencies as well. Anyone every attempting to install software like this will be able to tell you it is not a fun job to do and it can take a lot of time. However, having an insight into dependencies upfront can safe a lot of time.

A way to ensure that you know more upfront is to use some simple commands. When you have an Oracle Linux machine already installed which can access the public internet you can for example run the yum command with the deplist attribute.

the below example is from the deplist attribute where we filter on lines containing "dependency" reason for that is, it will by default also show you the "provider" result which might be a very long list.

[root@testbox09 lynis]# yum deplist man | grep dependency
  dependency: coreutils
  dependency: rpm
  dependency: nroff-i18n
  dependency: libc.so.6(GLIBC_2.3.4)(64bit)
  dependency: /bin/bash
  dependency: libc.so.6()(64bit)
  dependency: libc.so.6(GLIBC_2.4)(64bit)
  dependency: less
  dependency: config(man) = 1.6f-29.el6
  dependency: lzma
  dependency: libc.so.6(GLIBC_2.3)(64bit)
  dependency: rtld(GNU_HASH)
  dependency: bzip2
  dependency: findutils
  dependency: gzip
  dependency: /bin/sh
  dependency: mktemp >= 1.5-2.1.5x
  dependency: libc.so.6(GLIBC_2.2.5)(64bit)
  dependency: groff >= 1.18
  dependency: coreutils
  dependency: rpm
  dependency: nroff-i18n
  dependency: libc.so.6(GLIBC_2.3.4)(64bit)
  dependency: /bin/bash
  dependency: libc.so.6()(64bit)
  dependency: libc.so.6(GLIBC_2.4)(64bit)
  dependency: less
  dependency: config(man) = 1.6f-30.el6
  dependency: mktemp >= 1.5-2.1.5x
  dependency: libc.so.6(GLIBC_2.3)(64bit)
  dependency: rtld(GNU_HASH)
  dependency: bzip2
  dependency: findutils
  dependency: gzip
  dependency: /bin/sh
  dependency: lzma
  dependency: libc.so.6(GLIBC_2.2.5)(64bit)
  dependency: groff >= 1.18
  dependency: coreutils
  dependency: rpm
  dependency: nroff-i18n
  dependency: libc.so.6(GLIBC_2.3)(64bit)
  dependency: /bin/bash
  dependency: libc.so.6()(64bit)
  dependency: libc.so.6(GLIBC_2.4)(64bit)
  dependency: less
  dependency: libc.so.6(GLIBC_2.3.4)(64bit)
  dependency: lzma
  dependency: config(man) = 1.6f-32.el6
  dependency: rtld(GNU_HASH)
  dependency: bzip2
  dependency: findutils
  dependency: gzip
  dependency: /bin/sh
  dependency: mktemp >= 1.5-2.1.5x
  dependency: libc.so.6(GLIBC_2.2.5)(64bit)
  dependency: groff >= 1.18
[root@testbox09 lynis]#

Here you see that a simple package as man has a lot of dependencies. Without the filtering you will have lines like the one below:

 dependency: libc.so.6(GLIBC_2.2.5)(64bit)
   provider: glibc.x86_64 2.12-1.7.el6_0.3

This shows the libc.so.6 is porvided by glibc.x86_64. Having this information up front can safe a lot of time when preparing an installation on a disconnected machine. You can also use some rpm command attributes as shown below to get more insight into the dependencies a RPM file might have during installation:

  • rpm -Uvh --test *.rpm
  • rpm -qpR *.rpm

No comments: